[Bug] HF-to-Megatron conversion for Qwen2.5 models
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.
- 0.5B Model: Converts with no error, but the resulting model is broken—it gets a near-zero score on GSM8k at step 0.
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.
Has anyone else encountered this and found a reliable workaround?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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