Add sglang and Megatron-LM as git submodules under third_party/ - #2493
Open
Shi-Dong wants to merge 1 commit into
Open
Add sglang and Megatron-LM as git submodules under third_party/#2493Shi-Dong wants to merge 1 commit into
Shi-Dong wants to merge 1 commit into
Conversation
Record the exact sglang and Megatron-LM revisions miles is built against as git submodules, so a single miles commit pins the whole dependency triple. Today the two are resolved at image-build time by branch name: docker/Dockerfile does `git fetch origin sglang-miles` and `git clone -b miles-main radixark/Megatron-LM`. Whoever last pushed to those branches therefore decides what a given miles commit builds against, and nothing in the miles tree records the answer after the fact. This commit changes no build or runtime behaviour. docker/Dockerfile and every CI workflow keep resolving sglang/Megatron-LM exactly as before - no workflow in this repo passes `submodules:` to actions/checkout, so the new directories are never even populated in CI. The submodules are inert on-disk pointers whose only job for now is to be the source the miles-rl wheel is built from (follow-up PR). Pins match the current branch tips: third_party/sglang sgl-project/sglang @ sglang-miles cb05a44f3 third_party/Megatron-LM radixark/Megatron-LM @ miles-main 37f91617b Both use https:// URLs so unauthenticated clones and GitHub-hosted runners can fetch them without SSH credentials.
This was referenced Aug 13, 2026
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
.gitmodulesplus two submodule pointers underthird_party/:third_party/sglang→sgl-project/sglang@ branchsglang-miles, pinned atcb05a44f3third_party/Megatron-LM→radixark/Megatron-LM@ branchmiles-main, pinned at37f91617bWhy
Right now a miles commit does not record which sglang and which Megatron-LM it is built
against.
docker/Dockerfileresolves both by branch name at image-build time — it runsgit fetch origin sglang-milesagainst the sglang checkout in the base image, andgit clone -b miles-main https://github.com/radixark/Megatron-LM.git. So whoever pushed tothose branches most recently decides what any given miles commit builds against, and after
the fact there is no way to look at a miles commit and answer "which sglang was that?".
A git submodule is exactly that missing record: the miles tree stores an immutable commit id
per dependency. Bumping a dependency becomes an ordinary reviewable commit ("bump sglang from
X to Y") instead of an invisible side effect of someone else's push.
This is also the prerequisite for building the
miles-rlwheel reproducibly — the wheel needsthe patched sglang and Megatron-LM source, and a submodule is how that source gets into
the build. That part is a separate follow-up PR; this one deliberately does nothing but record
the pointers.
Why this is safe to land on its own
submodules:toactions/checkout, so CI never populatesthese directories and clone times are unchanged.
docker/Dockerfilestill installs sglang and Megatron-LMthe way it does today; it does not read
third_party/. It also clones miles without--recursive, so the directories stay empty inside the image.https://, so unauthenticated clones and GitHub-hosted runners can fetch themwithout SSH credentials.
git submodule update --init.Test plan
git submodule update --init --depth 1populates both submodules and checks out exactly thepinned commits (verified locally:
cb05a44f3and37f91617b).git diff --name-status main...HEADshows only the three added entries.adding the pointers is inert.