[Coverage] Direct unit-test suites for five untested core modules (conversion, core_utils, tensor_quantizer, model_calib, export/postprocess) — plus bugs found along the way
メンテナーはふだん 2 日以内に返信
@kevalmorabia97 がすでに取り組んでいます。
2026年7月21日 から。
評価
この issue はまだ評価されていません。
説明
Summary
While auditing test coverage, we found that several load-bearing modules have no direct unit-test file — they are exercised only incidentally through higher-level flows. We wrote hermetic, CPU-only unit suites (per CONTRIBUTING's tests/unit rules: fast, no network, no GPU) for five of them, adversarially reviewed and mutation-checked each suite, and will attach one PR per module so each is reviewable in isolation:
| Module | Suite | Tests |
|---|---|---|
torch/quantization/conversion.py |
test_conversion.py | 63 |
torch/quantization/utils/core_utils.py |
test_core_utils.py | 128 |
torch/quantization/nn/modules/tensor_quantizer.py |
test_tensor_quantizer.py | 90 (incl. hand-computed INT8/FP8/block fake-quant values) |
torch/quantization/model_calib.py |
test_model_calib.py | 42 |
torch/export/postprocess.py |
test_postprocess.py | 74 (TP/PP split layouts, padding math) |
397 tests, ~4.2k lines, total runtime ~5s. Each suite was verified to kill seeded mutations of its target (wrong scale direction, flipped split axes, broken running-max, etc.), so this is regression-detection capacity, not line-count.
Bugs found while writing these (documented in-test with NOTE: documents current behavior comments; happy to file/fix separately as preferred)
_normalize_fused_experts_quantizer_namecollides withSequentialQuantizerchild names (introduced in #1340: the singularweight_quantizer.<N>pattern matches sequential children). Two consequences, both reproduced: (a) applying the same list-of-configs twice viaset_quantizer_attributes_fullnestsSequentialQuantizers inside sub-slots (non-idempotent, corrupt state); (b)set_quantizer_attributes_partialwith a list and a*weight_quantizerwildcard now raisesValueErrormid-iteration for targets that are already sequential — a regression against its own docstring. Suggested fix: skip normalization when the matched quantizer's parent is aSequentialQuantizer.awq()silently no-ops on an unknown algorithm string (public__all__API; only themtq.quantizeconfig layer validates the literal). One-lineraise ValueErrorin an else would match the module's fail-fast style.TensorQuantizer.extra_reprdead code: the disabled branch builds a detailed string, then returns the literal"disabled", discarding it.update_lm_head_quantizationwarns "Enable lm_head quantization" even when quantizers are already disabled, and its sole call site (model_config_export.py:323) appears to passinference_pipeline_parallelinto theinference_tensor_parallelparameter.- Minor exception-safety inconsistencies:
replace_function/calibrate_with_adapters/enable_fake_quantyield without try/finally (unlikeexport_torch_modeet al.), so an exception mid-context leaks the patched state.
The behavior-documenting tests are written to fail-and-force-update when these are fixed.
PRs
Will be linked below, one per module, each self-contained.
- 主要言語
- Python
- スター
- 5.3k
- フォーク
- 745
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 160
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/Model-Optimizer のほかの issue
-
[Bug] modelopt-mcp: all launcher subprocesses hang when the server runs as a stdio MCP server — missing stdin=DEVNULL対応中かも @ChenhanYu が 14 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NVIDIA/Model-Optimizer#2551 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Puzzletron Progress 6/8 (calculating one block scores) takes 10 to 20 times more than in tutorial再び着手できるかも @tejasng053 が 21 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
NVIDIA/Model-Optimizer#1667 ·
メンテナーはふだん 2 日以内に返信
-
fp4_kernel_hopper.py uses tl.make_block_ptr, which is removed in Triton main (breaks NVFP4 fake quant)対応中かも @kinjalpatel27 が 1 日前に担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 72/100
NVIDIA/Model-Optimizer#2810 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
test_cast_fp4_impl_gpu_mem is flaky on Jetson Thor: mem_get_info reports system-wide memory on integrated GPUs対応中かも @LinCanNerd が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
NVIDIA/Model-Optimizer#2706 ·
メンテナーはふだん 2 日以内に返信
-
test_cuda_pack_reconstruction_matches_pytorch_at_scale[iq1_m] fails on Jetson Thor: exact ties exceed the blocks // 1000 bound対応中かも @LinCanNerd が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
NVIDIA/Model-Optimizer#2705 ·
メンテナーはふだん 2 日以内に返信
NVIDIA/Model-Optimizer の issue をすべて見る
似ている issue
-
bot-triaged module: LrScheduler module: optimizer triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
documentation glm5 llm-model
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vllm-project/vllm-ascend#19062 ·
メンテナーはふだん 1 日以内に返信
-
author-page correction
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
acl-org/acl-anthology#10496 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Issue Type: Bug Report
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
celery/celery#10875 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
SasanLabs/VulnerableApp#836 ·
メンテナーはふだん 1 日以内に返信