-
Notifications
You must be signed in to change notification settings - Fork 21
feat: add SGLang colocate plugin and colocate P2P transfer fixes #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bbbd10e
88e7dbd
562e83d
e2dd320
024fb09
8425cb0
6a897de
5109a75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,7 +99,17 @@ class SGlangToHFWeightConverterBailingMoeLinear( | |
| LinearMLASGlangConverterMixin, | ||
| SGlangToHFWeightConverter, | ||
| ): | ||
| pass | ||
| def convert_param( | ||
| self, name: str, parameter: torch.Tensor | ||
| ) -> List[Tuple[str, torch.Tensor]]: | ||
| # SGLang's BailingMoe names the input embedding ``word_embeddings``, | ||
| # while the canonical HF name (and the train-side mcore converter output) | ||
| # is ``embed_tokens``. Normalize here so the transfer-plan key sets on | ||
| # both sides align; the base converter has no rule for ``word_embeddings`` | ||
| # and would otherwise pass it through unchanged. | ||
| if name == "model.word_embeddings.weight": | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This rename also changes the sharding decision.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 6a897de — the sharding fallback in param_sharding.py now recognizes embed_tokens as an embedding, so the normalized canonical name keeps the replicated-embedding semantics (Bailing's get_embedding_sharding_strategy override included) instead of falling through to generic TP_SHARDING. |
||
| name = "model.embed_tokens.weight" | ||
| return super().convert_param(name, parameter) | ||
|
|
||
|
|
||
| CONFIG = [ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For MHA,
expected_compact_sizeandexpected_replicated_sizeare both3 * hidden_size, so this changed ordering always interprets the weight as interleaved.transform_mcore_qkv_bias()still checks the replicated case first and interprets the identically shaped bias as contiguous[Q; K; V]. A fused QKV linear uses the same output-row ordering for weight and bias, so biased models now permute them inconsistently. Use one explicit layout signal/shared transform for both; shape alone cannot distinguish these MHA layouts.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 6a897de — transform_mcore_qkv_bias now checks the compact layout before the replicated one, mirroring transform_mcore_qkv_weight, so in the MHA case (where the two sizes coincide) weight and bias resolve to the same interleaved interpretation. A shared explicit layout signal would indeed be more robust long-term; left as a follow-up since it touches the converter API surface.