-
Notifications
You must be signed in to change notification settings - Fork 598
[Feature] Add Qwen3.8-27B local-Hessian PTQ recipes #2363
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 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. | ||
|
|
||
| # PTQ recipe wrapping the shipped NVFP4 W4A4 local-Hessian preset. | ||
|
|
||
| imports: | ||
| preset: configs/ptq/presets/model/nvfp4_w4a4_weight_local_hessian | ||
|
|
||
| metadata: | ||
| recipe_type: ptq | ||
| description: >- | ||
| Applies NVFP4 W4A4 with static weight scales, dynamic inputs, KV quantizers disabled, and | ||
| local-Hessian weight calibration with an FP8-scale sweep. | ||
| quantize: | ||
| $import: preset |
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BB: Rename this file to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🐝 On it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Blocked for now: the live PR branch was force-updated and the canonical checkout has divergent history. I preserved the checkout and artifacts and asked privately for approval to realign it before applying this rename. The PR monitor remains active.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Blocked for now: the canonical checkout is on |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 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. | ||
|
|
||
| # modelopt-schema: modelopt.recipe.config.ModelOptPTQRecipe | ||
| imports: | ||
| base: models/Qwen/Qwen3.8-27B/ptq/max_nvfp4_w4a4_mlp_fp8_attn | ||
|
|
||
| metadata: | ||
| recipe_type: ptq | ||
| description: >- | ||
| Qwen3.8-27B local-Hessian PTQ using the NVFP4 W4A4 and FP8 W8A8 assignment exported by | ||
| the 5.5-bit NVFP4-max AutoQuantize sweep. | ||
|
|
||
| quantize: | ||
| $import: base | ||
| algorithm: | ||
| method: local_hessian | ||
| fp8_scale_sweep: true | ||
| layerwise: | ||
| enable: true | ||
| get_qdq_activations_from_prev_layer: true |
|
realAsma marked this conversation as resolved.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BB: Rename this file to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🐝 On it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🐝 Got it — I’ll rename the recipe file and update its references.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Blocked for now: the live PR branch was force-updated and the canonical checkout has divergent history. I preserved the checkout and artifacts and asked privately for approval to realign it before applying this rename. The PR monitor remains active.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Blocked for now: the canonical checkout is on |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 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. | ||
|
|
||
| # QuantizeConfig for the precision assignment exported by a 5.5-bit NVFP4-max AutoQuantize sweep. | ||
|
|
||
| # modelopt-schema: modelopt.torch.quantization.config.QuantizeConfig | ||
| imports: | ||
| base_disable_all: configs/ptq/units/base_disable_all | ||
| fp8: configs/numerics/fp8 | ||
| nvfp4: configs/numerics/nvfp4 | ||
| nvfp4_static: configs/numerics/nvfp4_static | ||
|
|
||
| algorithm: max | ||
| quant_cfg: | ||
| - $import: base_disable_all | ||
|
|
||
| - quantizer_name: '*language_model.layers.*.mlp.*.weight_quantizer' | ||
| cfg: {$import: nvfp4_static} | ||
| - quantizer_name: '*language_model.layers.*.mlp.*.input_quantizer' | ||
| cfg: {$import: nvfp4} | ||
|
|
||
| - quantizer_name: '*language_model.layers.*.self_attn.*_proj.weight_quantizer' | ||
| cfg: {$import: fp8} | ||
| - quantizer_name: '*language_model.layers.*.self_attn.*_proj.input_quantizer' | ||
| cfg: {$import: fp8} | ||
| - quantizer_name: '*language_model.layers.*.linear_attn.*_proj*.weight_quantizer' | ||
| cfg: {$import: fp8} | ||
| - quantizer_name: '*language_model.layers.*.linear_attn.*_proj*.input_quantizer' | ||
| cfg: {$import: fp8} | ||
|
|
||
| - quantizer_name: '*lm_head.weight_quantizer' | ||
| cfg: {$import: nvfp4_static} | ||
| - quantizer_name: '*lm_head.input_quantizer' | ||
| cfg: {$import: nvfp4} | ||
|
|
||
| # These projections were excluded from the AutoQuantize search but match the | ||
| # broad linear-attention patterns above, so disable them last. | ||
| - quantizer_name: '*linear_attn.in_proj_a*' | ||
| enable: false | ||
| - quantizer_name: '*linear_attn.in_proj_b*' | ||
| enable: false |
Uh oh!
There was an error while loading. Please reload this page.