Skip to content

e2e example with HF model + MoE + torchao nvfp4#4319

Merged
vkuzo merged 38 commits intomainfrom
gh/vkuzo/255/head
Apr 23, 2026
Merged

e2e example with HF model + MoE + torchao nvfp4#4319
vkuzo merged 38 commits intomainfrom
gh/vkuzo/255/head

Conversation

@vkuzo
Copy link
Copy Markdown
Contributor

@vkuzo vkuzo commented Apr 23, 2026

Summary:

Small e2e script for hf moe model + torchao nvfp4 inference.

There are a couple of workarounds needed, they are noted
with TODO comments and will be addressed in future PRs.

Test Plan:

python scripts/prototype/test_nvfp4_moe.py --recipe bf16
python scripts/prototype/test_nvfp4_moe.py --recipe nvfp4
// outputs nearly identical

// nvfp4
| Tasks  |Version|Filter|n-shot|    Metric     |   |Value |   |Stderr|
|--------|------:|------|-----:|---------------|---|-----:|---|------|
|wikitext|      2|none  |     0|bits_per_byte  |↓  |0.6024|±  |   N/A|
|        |       |none  |     0|byte_perplexity|↓  |1.5183|±  |   N/A|
|        |       |none  |     0|word_perplexity|↓  |9.3277|±  |   N/A|

vkuzo added 30 commits April 20, 2026 20:52
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added 4 commits April 23, 2026 09:27
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@vkuzo
Copy link
Copy Markdown
Contributor Author

vkuzo commented Apr 23, 2026

@vkuzo vkuzo requested a review from jerryzh168 as a code owner April 23, 2026 13:03
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Apr 23, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4319

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 23, 2026
@vkuzo vkuzo added the module: not user facing Use this tag if you don't want this PR to show up in release notes label Apr 23, 2026
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Apr 23, 2026
Summary:

Small e2e script for hf moe model + torchao nvfp4 inference.

There are a couple of workarounds needed, they are noted
with `TODO` comments and will be addressed in future PRs.

Test Plan:

```
python scripts/prototype/test_nvfp4_moe.py --recipe bf16
python scripts/prototype/test_nvfp4_moe.py --recipe nvfp4
// outputs nearly identical
```
ghstack-source-id: 5d4c20a
ghstack-comment-id: 4304573258
Pull-Request: #4319
@jerryzh168
Copy link
Copy Markdown
Contributor

I remember seeing similar scripts of testing quantizing a model and check performance / accuracy somewhere else before as well, should we centralize these?

vkuzo added 2 commits April 23, 2026 17:21
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@vkuzo vkuzo changed the base branch from gh/vkuzo/254/head to main April 23, 2026 18:45
@vkuzo vkuzo merged commit 488f33c into main Apr 23, 2026
20 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: not user facing Use this tag if you don't want this PR to show up in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants