Commit 41828cb
committed
[6114983] Restore qdq_utils symbols used by edgellm 0.6.1
Bug 6114983 reports that even after #1356 restored
``modelopt.onnx.llm_export_utils`` as a deprecation shim, TensorRT-Edge-LLM
0.6.1 still fails at module load. The next line in ``onnx_utils.py`` is
from modelopt.onnx.quantization.qdq_utils import (
fp4qdq_to_2dq, quantize_weights_to_int4, quantize_weights_to_mxfp8,
)
These three symbols were removed when the LLM ONNX export pipeline was
refactored into the new staged ``modelopt.onnx.export`` exporters
(INT4/NVFP4/MXFP8). Their behavior is preserved by the new exporters, but
edgellm 0.6.1 imports the old top-level functions unconditionally, so the
import chain still aborts with ``ImportError``.
This restores the three functions on ``modelopt.onnx.quantization.qdq_utils``
as deprecation shims that emit ``DeprecationWarning`` and reuse the existing
helpers (``_cast_fp8`` here, ``_cast_fp4`` and ``_replace_fp4qdq_with_2dq``
from ``modelopt.onnx.export.nvfp4_exporter`` via lazy import to avoid a
circular import). No new files; only one file changes. The deprecation
message points readers to the new exporters and to TensorRT-Edge-LLM as the
long-term migration target.
I also audited every other ``modelopt`` import edgellm 0.6.1 makes
(``modelopt.torch.quantization``, ``modelopt.torch.opt``,
``modelopt.torch.export.quant_utils``, ``modelopt.onnx.quantization.gs_patching``,
etc.) and confirmed they all still resolve on current main; only the three
``qdq_utils`` symbols above were missing.
Verified with:
- All 4 edgellm-side import lines from the bug's traceback now succeed.
- ``tests/unit/onnx/quantization/test_qdq_utils.py`` and
``tests/unit/onnx/test_onnx_utils.py`` (36 tests) pass.
- Each restored shim emits ``DeprecationWarning`` when called.
Signed-off-by: ajrasane <131806219+ajrasane@users.noreply.github.com>1 parent 097293b commit 41828cb
1 file changed
Lines changed: 390 additions & 1 deletion
0 commit comments