NVIDIA / NVIDIA/TensorRT-LLM

[Doc]: NVFP4 minimal example code

Open
#6,835 1 comment 0 reactions 1 assignee View on GitHub

@nv-guomingz is already working on this.

Since Aug 12, 2025.

Doc Investigating triaged
Dominant language
Python
Stars
14.7k
Forks
2.8k
Avg merge
2d 23h
Merged PRs (30d)
489

Description

📚 The doc issue

Hi, NVFP4 seems like a really good format, and may well be used for training as well as quantization in the future. However I couldn't find any documentation how this actually works, and also not in the code. There's only this blog post.

Is there a simple pytorch function that demonstrates how to fake quantize a tensor from FP32 to NVFP4?
A small example to show how it works, without requiring the full TensorRT-LLM or TransformerEngine dependency, would be very helpful.

Suggest a potential alternative/fix

No response

Before submitting a new issue...
  • Make sure you already searched for relevant issues, and checked the documentation and examples for answers to frequently asked questions.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.