Skip to content

[docs] deepgemm - #46361

Merged
stevhliu merged 5 commits into
huggingface:mainfrom
stevhliu:deepgemm
Jun 8, 2026
Merged

stevhliu merged 5 commits into
huggingface:mainfrom
stevhliu:deepgemm

Conversation

@stevhliu

@stevhliu stevhliu commented Jun 3, 2026

Copy link
Copy Markdown
Member

adds docs for #45634:

  • deepgemm with fp8/fp4 quantized experts, deepgemm_megamoe and sonicmoe sections
  • deepgemm fast path and UE8M0 scale format to the finegrained fp8 docs

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.


## UE8M0 scale format

DeepSeek V4-style checkpoints store FP8 weight scales in the packed `float8_e8m0fnu` format instead of `float32`. Pass `scale_fmt="ue8m0"` to load these checkpoints. UE8M0 scales must take the DeepGEMM path (the Triton fallback only reads `float32` scales) so the same hardware and `kernels` requirements apply.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

passing scale_fmt="ue8m0" is unnecesary, normally it should be in the quant config shipped with the model, and we try to honor it during weight init. one problem though is that even if it's specified, the on-disk (safetensors) scales need to respect it. this is not the case in https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-Base for example where scale_fmt="ue8m0" but the safetensors stores them as fp32 🥲. i forgot to mention this in my previous PR, @ArthurZucker do you think we should cast the scales to ue8m0 if scale_fmt="ue8m0" or keep them in the on-disk format ?

Comment thread docs/source/en/experts_interface.md Resolved
Comment thread docs/source/en/experts_interface.md Resolved
Comment thread docs/source/en/experts_interface.md Resolved
Comment thread docs/source/en/experts_interface.md Resolved

@IlyasMoutawwakil IlyasMoutawwakil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot @stevhliu ! i left some comments

@stevhliu
stevhliu requested a review from IlyasMoutawwakil June 8, 2026 19:27
@stevhliu

stevhliu commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

i also updated the docs with #46407 :)

@IlyasMoutawwakil IlyasMoutawwakil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! nice docs !

@stevhliu
stevhliu added this pull request to the merge queue Jun 8, 2026
Merged via the queue into huggingface:main with commit 5511554 Jun 8, 2026
33 checks passed
@stevhliu
stevhliu deleted the deepgemm branch June 8, 2026 22:37
louzongzhi pushed a commit to louzongzhi/transformers that referenced this pull request Jun 10, 2026
* docs

* sonicmoe

* polish

* feedback

* triton
louzongzhi pushed a commit to louzongzhi/transformers that referenced this pull request Jun 10, 2026
* docs

* sonicmoe

* polish

* feedback

* triton
stevhliu added a commit to stevhliu/transformers that referenced this pull request Jul 30, 2026
* docs

* sonicmoe

* polish

* feedback

* triton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants