Megatron-LM icon indicating copy to clipboard operation
Megatron-LM copied to clipboard

DeepSeek V4 FP8 training some parameters need keep bfloat16

Open ZHUI opened this issue 5 months ago • 2 comments

Describe the bug

    --fp8_recipe blockwise \
    --fp8_format e4m3  \
    --fp8_param_gather True \
Image

我们这边发现,FP8训练保存下来的模型。

  • compressor 的 wgate wkv 也被量化训练了。但是官方ckpt是bf16
  • 另外 ape 是fp32的,开启bf16的时候这部分的参数也变成fp32。官方ckpt是fp32

参考:https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-Base/tree/main?show_file_info=model-00004-of-00046.safetensors Image

Steps/Code to reproduce bug

Please list minimal steps or code snippet for us to be able to reproduce the bug.

A helpful guide on on how to craft a minimal bug report http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports.

Expected behavior

A clear and concise description of what you expected to happen.

Additional context

Add any other context about the problem here.

ZHUI avatar Jun 10 '26 10:06 ZHUI

Thanks! We will look into it and may fix it along with the o_group fp8 gemm.

hxbai avatar Jun 11 '26 03:06 hxbai

@hxbai I have PR for this issue. Please review it.

ssam18 avatar Jun 11 '26 21:06 ssam18