THUDM / THUDM/slime

[Question] Implementing slightly new architecture for slime without invasive updates to native Megatron

Open
#1,168 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.5k
Forks
1.3k
Avg merge
5h 36m
Merged PRs (30d)
22

Description

Hi,

I'm interested in implementing our custom transformer-based model to slime without writing native megatron if possible. I saw this documentation with an example of Qwen3Next.

We're interested in the following features:

  • The model needs custom mask and our model currently uses flex attention in pytorch and flashinfer in SGLang.
  • Would context parallelism be possible if we go with this integration?
  • You mentioned that TP is not supported "within the replaced module". Could you illustrate a bit more on what defines a replaced module?

Our model is essentially a transformer (e.g. Qwen) with the following differences:

  • The input will be preprocessed before sending to the model (i'm sure its doable)
  • Different loss calculation (also seems easy to modify)
  • Attention pattern is customized per batch
  • We hope to apply TP and CP if possible

If TP is not possible for certain modules (attention for example), could you give me some hints on what's the largest possible model size and context length that this approach can support? Really appreciate your help!

Best

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with docs/en/advanced/arch-support-beyond-megatron.md and its Qwen3Next example to understand the supported integration boundary. Investigate how custom preprocessing, loss, attention, tensor parallelism, and context parallelism map to that approach; done would require a documented feasibility decision or a scoped implementation plan.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.