THUDM / THUDM/slime

[Bug] HF-to-Megatron conversion for Qwen2.5 models

Open
#345 1 comment 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

I've found a bug in the HF-to-Megatron conversion for Qwen2.5 models.
Here's what's happening:

  • 1.5B Model: Fails with a ValueError: missing lm_head.weight. Image
  • 0.5B Model: Converts with no error, but the resulting model is broken—it gets a near-zero score on GSM8k at step 0.
Image

Prompted by this anomaly, I inspected the model.safetensors on Hugging Face. As the attached screenshots show, neither the 0.5B nor the 1.5B variant contains a separate lm_head.weight tensor.
Image
Image
Has anyone else encountered this and found a reliable workaround?

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 at the HF-to-Megatron conversion entry point and inspect how model.safetensors tensors are mapped for the Qwen2.5 0.5B and 1.5B variants. Reproduce the missing lm_head.weight error and the near-zero GSM8k result; done means both models convert reliably and the resulting model no longer shows the reported failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.