NVIDIA/Model-Optimizer
A unified library of SOTA model optimization techniques like quantization, distillation, pruning, neural architecture search, speculative decoding, etc. It compresses deep learning models for downstream deployment frameworks like TensorRT-LLM, TensorRT, vLLM, etc. to optimize inference speed.
Python★ 4,148+44 that day#3 on trendingC 66.3 health4.16% duplicated
C66.3/100
Duplication77
3.1% in python, bash, cpp, c-header, perl, javascriptDead code78
2.6%Complexity48
53%Most complex files
- modelopt/onnx/utils.py539 cx
- modelopt/onnx/autocast/precisionconverter.py502 cx
- modelopt/torch/quantization/nn/modules/tensor_quantizer.py463 cx
- modelopt/torch/export/quant_utils.py460 cx
- modelopt/torch/quantization/algorithms.py453 cx
- modelopt/torch/quantization/model_calib.py442 cx
- modelopt/torch/export/unified_export_megatron.py430 cx
- tests/_test_utils/torch/nas_prune/models.py391 cx
- modelopt/torch/export/trtllm/layer_utils.py337 cx
- modelopt/torch/quantization/plugins/huggingface.py330 cx
Dead code 2.63% unused · 122 findings
- modelopt/torch/sparsity/attention_sparsity/plugins/vllm.pyunused-file
- tools/launcher/core.pyunused-file
- modelopt/torch/utils/mlflow.pyunused-file
- modelopt/torch/utils/plugins/transformers_dataset.pyunused-file
- modelopt/torch/sparsity/attention_sparsity/plugins/vllm_runtime.pyunused-file
- modelopt/torch/speculative/plugins/hf_streaming_dataset.pyunused-file
- modelopt/torch/speculative/plugins/rdma_hidden_states_connector.pyunused-file
- modelopt/torch/kernels/common/attention/decode_attention.pyunused-file
- modelopt/torch/utils/plugins/mbridge.pyunused-file
- modelopt/torch/sparsity/attention_sparsity/plugins/sparse_attn_calibration.pyunused-file
2,070files
436,782lines
2,486,565tokens
1,248clones
18,159duplicated lines (4.16%)
107,981duplicated tokens (4.34%)
By format
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| python | 1,247 | 371,685 | 870 | 11,619 | 3.13% |
| yaml | 394 | 22,513 | 302 | 5,732 | 25.46% |
| markdown | 187 | 27,856 | 45 | 433 | 1.55% |
| bash | 159 | 10,712 | 17 | 176 | 1.64% |
| cpp | 8 | 756 | 8 | 117 | 15.48% |
| c-header | 5 | 519 | 5 | 73 | 14.07% |
| txt | 10 | 140 | 1 | 9 | 6.43% |
| json | 17 | 923 | 0 | 0 | 0% |
| text | 26 | 572 | 0 | 0 | 0% |
| toml | 10 | 565 | 0 | 0 | 0% |
Largest clones
- 16 lines · 682 tokens cppexamples/onnx_ptq/custom_op_plugin/plugin/IdentityConvPlugin.cpp:1–16⇆examples/onnx_ptq/custom_op_plugin/plugin/IdentityConvPluginCreator.cpp:1–16
- 16 lines · 682 tokens cppexamples/onnx_ptq/custom_op_plugin/plugin/IdentityConvPlugin.cpp:1–16⇆examples/onnx_ptq/custom_op_plugin/plugin/PluginRegistration.cpp:1–16
- 16 lines · 682 tokens cppexamples/onnx_ptq/custom_op_plugin/plugin/IdentityConvPlugin.cpp:1–16⇆examples/onnx_ptq/custom_op_plugin/plugin/PluginUtils.cpp:1–16
- 16 lines · 682 tokens cppexamples/onnx_ptq/custom_op_plugin/plugin/IdentityConvPlugin.cpp:1–16⇆modelopt/onnx/quantization/src/modelopt_round_and_pack_ext.cpp:1–16
- 16 lines · 682 tokens cppexamples/onnx_ptq/custom_op_plugin/plugin/IdentityConvPlugin.cpp:1–16⇆modelopt/torch/kernels/quantization/conv/implicit_gemm_binding.cpp:1–16
- 16 lines · 682 tokens cppexamples/onnx_ptq/custom_op_plugin/plugin/IdentityConvPlugin.cpp:1–16⇆modelopt/torch/kernels/quantization/gemm/tensor_quant.cpp:1–16
- 16 lines · 682 tokens c-headerexamples/onnx_ptq/custom_op_plugin/plugin/IdentityConvPlugin.h:1–16⇆examples/onnx_ptq/custom_op_plugin/plugin/IdentityConvPluginCreator.h:1–16
- 16 lines · 682 tokens c-headerexamples/onnx_ptq/custom_op_plugin/plugin/IdentityConvPlugin.h:1–16⇆examples/onnx_ptq/custom_op_plugin/plugin/PluginUtils.h:1–16
- 16 lines · 682 tokens c-headerexamples/onnx_ptq/custom_op_plugin/plugin/IdentityConvPlugin.h:1–16⇆modelopt/torch/kernels/quantization/gemm/tensor_quant.h:1–16
- 16 lines · 682 tokens c-headerexamples/onnx_ptq/custom_op_plugin/plugin/IdentityConvPlugin.h:1–16⇆modelopt/torch/kernels/quantization/gemm/tensor_quant_mx.h:1–16
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | Duplication | Health | Commit |
|---|---|---|---|---|---|---|---|---|
| Sep 25, 2026 | #3 | 4,148 (+44) | 2,070 | 436,782 | 1,248 | 4.16% | C 66.3 | ed7e879 |
Want this for your own project? Install jscpd and run jscpd .