-
Notifications
You must be signed in to change notification settings - Fork 428
Support NVFP4 W4A16 quantization #1313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
6e456b0
fix: PTQ 1GPU, export PP divisibility, hidden states conversations key
ChenhanYu 48d0a37
add nvfp4-w4a16 support
hychiang-git f34694b
Merge branch 'main' into hungyueh/modelopt-nvfp4-w4a16
hychiang-git 2ee0825
update CHANGELOG.rst and add test for nvfp4 w4a16
hychiang-git 0e8815d
tiny fix on CHANGELOG.rst
hychiang-git dc506c6
tiny fix on CHANGELOG.rst
hychiang-git d8611e2
f*{mod}*_quantizer -> f*{mod}*.weight_quantizer and f*{mod}*.input_qu…
hychiang-git 4b62138
Merge branch 'main' into hungyueh/modelopt-nvfp4-w4a16
hychiang-git 36ce897
Merge branch 'main' into hungyueh/modelopt-nvfp4-w4a16
hychiang-git 41f9988
Merge branch 'main' into hungyueh/modelopt-nvfp4-w4a16
hychiang-git c3b884a
rm --exclude_modules
hychiang-git 75ff6b2
rm --exclude_modules
hychiang-git b3a40fd
Merge branch 'main' into hungyueh/modelopt-nvfp4-w4a16
hychiang-git 81f845a
Merge branch 'main' into hungyueh/modelopt-nvfp4-w4a16
hychiang-git 0fede96
nvfp4_w4a16 -> w4a16_nvfp4
hychiang-git 2cc3230
fix vllm comments
hychiang-git 9409858
merge main, resolve conflicts
hychiang-git ea1d0b2
Merge branch 'main' into hungyueh/modelopt-nvfp4-w4a16
hychiang-git 8594574
make huggingface_example.sh and parser.sh support recipes
hychiang-git 9808e01
add w4a16_nvfp4 recipes
hychiang-git e8c0602
fix: call mono_quantize() for --recipe path regardless of --qformat d…
hychiang-git 08cd44f
add weight-only supports in _QuantFusedExperts
hychiang-git 2c9186f
merge main
hychiang-git 27bab2b
Merge branch 'main' into hungyueh/modelopt-nvfp4-w4a16
hychiang-git f3e4a13
Merge branch 'main' into hungyueh/modelopt-nvfp4-w4a16
hychiang-git f0b1113
rename w4a16_nvfp4.yaml to w4_nvfp4.yaml
hychiang-git 62dd281
Merge branch 'hungyueh/modelopt-nvfp4-w4a16' of github.com:NVIDIA/Mod…
hychiang-git 6cad5ea
merge main and resolve conflicts
hychiang-git ad01342
w4a16_nvfp4: configs/ptq/units/w4a16_nvfp4 -> w4a16_nvfp4: configs/pt…
hychiang-git 1be38df
Merge branch 'main' into hungyueh/modelopt-nvfp4-w4a16
hychiang-git 56a1e78
rm comments
hychiang-git 27fbb53
rm docker guard
hychiang-git 14d5e0d
refactor: simplify mono_quantize condition to if quant_cfg
hychiang-git d3e2c90
Merge branch 'main' into hungyueh/modelopt-nvfp4-w4a16
hychiang-git File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # W4A16 NVFP4: NVFP4 E2M1 dynamic weight quantizer only; activations remain in BF16. | ||
|
|
||
| # modelopt-schema: modelopt.torch.quantization.config.QuantizerCfgListConfig | ||
| imports: | ||
| nvfp4: configs/numerics/nvfp4 | ||
| --- | ||
| - quantizer_name: '*weight_quantizer' | ||
|
hychiang-git marked this conversation as resolved.
|
||
| cfg: | ||
| $import: nvfp4 | ||
29 changes: 29 additions & 0 deletions
29
modelopt_recipes/general/ptq/nvfp4_weight_only-kv_fp16.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| imports: | ||
| base_disable_all: configs/ptq/units/base_disable_all | ||
| default_disabled_quantizers: configs/ptq/units/default_disabled_quantizers | ||
| w4a16_nvfp4: configs/ptq/units/w4_nvfp4 | ||
|
|
||
| metadata: | ||
|
hychiang-git marked this conversation as resolved.
|
||
| recipe_type: ptq | ||
| description: NVFP4 W4A16 weight-only, BF16 activations, max calibration. No calibration forward pass required. | ||
| quantize: | ||
| algorithm: max | ||
| quant_cfg: | ||
| - $import: base_disable_all | ||
| - $import: w4a16_nvfp4 | ||
| - $import: default_disabled_quantizers | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.