build(base): rebase the Baseten patches onto NVIDIA main (82894c4d) - #33
Merged
XiaohanZhangCMU merged 0 commit intoAug 20, 2026
Merged
Conversation
XiaohanZhangCMU
force-pushed
the
trainers-main
branch
from
August 20, 2026 05:35
f75e7a5 to
a7234ad
Compare
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.
Cherry-picked the ten Baseten patches from
trainers-mainonto NVIDIA main82894c4d(2026-08-19), pinned rather than tracking the branch. History is[NVIDIA commits][10 Baseten commits], linear, no merge commits. Delta above the base: 13 files, +358/-25.trainers-mainwas NVIDIA main ata2496aa1(2026-07-09) plus those ten commits; NVIDIA has moved 370 commits since.basetenlabs/Megatron-LM:mainis untouched and unused.Replaces #32, which was based on the single MCore commit the Kimi-K3 bridge pins rather than on NVIDIA main.
Exactly what I ran
That last command stops here:
Reproducible from a clean checkout with just those commands.
Why the conflicts exist
Seven of the ten applied automatically. The three that did not are all files upstream edited in those 370 commits:
And each of the three applies cleanly onto its own merge-base, which is what rules out a wrong base:
So the conflicts are upstream having touched the same lines, not the base being wrong. The only conflict-free target is
a2496aa1- the July base this PR exists to leave.How each was resolved
megatron/core/tensor_parallel/layers.py+tests/unit_tests/tensor_parallel/test_layers.py- upstream addedgrad_output = grad_output.to(ctx.input_dtype)ahead of thedim() > 2dispatch our int32-stride patch replaces. Kept upstream's cast and ourdim() == 3fast path. The test conflict was additive on both sides with no overlapping names: union of upstream's three FP32-output tests and our non-contiguous-grad test.megatron/core/transformer/moe/token_dispatcher.py- two additive blocks. Union: upstream'sget_expert_zero_copy_buffersplus our_clear_forward_state, and our five= Noneresets in_HybridEPManager.pyproject.toml- rewritten instead of replayed. The old patch relaxed~=0.4.0to>=0.4.0,<0.6so 0.5.x was admitted; upstream now pins==0.5.1, which does that but sits below what Kimi-K3 needs. Before 0.5.2,chunk_kdaacceptsA_loganddt_biasthrough**kwargsand silently discards them, so the KDA forget gate trains wrong with nothing raised. Now>=0.5.2,<0.6.Checking the result
Testing
Not run - the suite needs GPUs. Static only: no conflict markers, every changed file parses. The gate is the validation matrix, which needs to cover GLM-5.2 THD-CP, DSv4-Flash, MiMo and Qwen as well as Kimi-K3, since these patches serve all of them.