Skip to content

Commit 41f21bc

Browse files
authored
Update custom file name patterns when copy files and remove problematic parameters in export (#520)
## What does this PR do? **Type of change:** Bugfix <!-- Use one of the following: Bug fix, new feature, new example, new tests, documentation. --> **Overview:** - Update custom file name patterns when copy files in export. - Remove problematic parameters in export for Nemotron Nano VL models - Resolve nvbugs https://nvbugspro.nvidia.com/bug/5637594 ## Usage <!-- You can potentially add a usage example below. --> ```python # Add a code snippet demonstrating how to use this ``` ## Testing <!-- Mention how have you tested your change if applicable. --> ## Before your PR is "*Ready for review*" <!-- If you haven't finished some of the above items you can still open `Draft` PR. --> - **Make sure you read and follow [Contributor guidelines](https://github.com/NVIDIA/TensorRT-Model-Optimizer/blob/main/CONTRIBUTING.md)** and your commits are signed. - **Is this change backward compatible?**: Yes <!--- If No, explain why. --> - **Did you write any new necessary tests?**: Yes/No - **Did you add or update any necessary documentation?**: Yes/No - **Did you update [Changelog](https://github.com/NVIDIA/TensorRT-Model-Optimizer/blob/main/CHANGELOG.rst)?**: Yes/No <!--- Only for new features, API changes, critical bug fixes or bw breaking changes. --> ## Additional Information <!-- E.g. related issue. --> --------- Signed-off-by: Zhiyu Cheng <[email protected]>
1 parent c1d624e commit 41f21bc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

examples/llm_ptq/example_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,10 @@ def copy_custom_model_files(source_path: str, export_path: str, trust_remote_cod
511511
# Common patterns for custom model files that need to be copied
512512
custom_file_patterns = [
513513
"configuration_*.py",
514-
"modeling_*.py",
514+
"modeling*.py",
515515
"tokenization_*.py",
516516
"processing_*.py",
517-
"image_processing_*.py",
517+
"image_processing*.py",
518518
"feature_extraction_*.py",
519519
"*.json",
520520
]

modelopt/torch/export/quant_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,11 @@ def postprocess_state_dict(state_dict: dict, maxbound: float, quantization: str
849849
post_state_dict = {}
850850

851851
for key, value in state_dict.items():
852+
# Skip problematic parameters for specific model architectures, e.g., Nemotron Nano VL models
853+
if key == "vision_model.radio_model.summary_idxs":
854+
logger.info(f"Removing problematic parameter: {key}")
855+
continue
856+
852857
# Skip keys not related to quantizers
853858
if (
854859
"output_quantizer" not in key

0 commit comments

Comments
 (0)