Repository navigation
Refactor quantization module: Remove PT2E quantization support - #2610
Merged
Merged
Conversation
- Deleted the `pt2e_export.py` file and its associated export functions. - Updated the `__init__.py` files to remove references to PT2E quantization. - Removed dynamic quantization configuration and related classes from the quantization config. - Cleaned up algorithm entry points by removing PT2E specific entries. - Updated save/load functions to eliminate PT2E dependencies. - Removed related tests for PT2E quantization. Signed-off-by: Xin He <xin3.he@intel.com>
…and remove direct dependency Signed-off-by: Xin He <xin3.he@intel.com>
for more information, see https://pre-commit.ci
xin3he
requested review from
chensuyue
and
a balanced review from Copilot
and removed request for
chensuyue
October 9, 2026 02:49
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Documentation still contains broken PT2E links, and the new optional torchao path lacks regression coverage.
1 open finding
What changed in this PR
Removes PyTorch PT2E quantization support and makes torchao optional for remaining CPU FP8 functionality.
Changes:
- Removes PT2E implementation, APIs, configuration, tests, and documentation.
- Routes static quantization exclusively through IPEX.
- Lazily imports
torchaofor CPU FP8 operations.
| File | Description |
|---|---|
test/torch/quantization/test_pt2e_quant.py |
Removes PT2E integration tests. |
test/torch/algorithms/pt2e_quant/test_pt2e_w8a8.py |
Removes W8A8 PT2E tests. |
test/torch/algorithms/pt2e_quant/test_half_precision_rewriter.py |
Removes rewriter tests. |
requirements_pt.txt |
Removes torchao dependency. |
neural_compressor/torch/utils/constants.py |
Removes PT2E constants. |
neural_compressor/torch/quantization/save_load_entry.py |
Removes PT2E loading. |
neural_compressor/torch/quantization/config.py |
Removes dynamic PT2E configuration. |
neural_compressor/torch/quantization/algorithm_entry.py |
Removes PT2E algorithm entries. |
neural_compressor/torch/quantization/__init__.py |
Removes dynamic configuration exports. |
neural_compressor/torch/export/pt2e_export.py |
Removes PT2E export implementation. |
neural_compressor/torch/export/__init__.py |
Removes PT2E export APIs. |
neural_compressor/torch/algorithms/pt2e_quant/utility.py |
Removes PT2E utilities. |
neural_compressor/torch/algorithms/pt2e_quant/save_load.py |
Removes PT2E persistence. |
neural_compressor/torch/algorithms/pt2e_quant/pt2e_compat.py |
Removes compatibility imports. |
neural_compressor/torch/algorithms/pt2e_quant/half_precision_rewriter.py |
Removes graph rewriting. |
neural_compressor/torch/algorithms/pt2e_quant/core.py |
Removes PT2E quantizer. |
neural_compressor/torch/algorithms/pt2e_quant/__init__.py |
Removes package exports. |
neural_compressor/torch/algorithms/fp8_quant/_core/quantized_func_wrappers/cpu/cpu_quantized_func_wrapper.py |
Lazily imports torchao. |
docs/source/PT_StaticQuant.md |
Removes PT2E static guidance. |
docs/source/PT_DynamicQuant.md |
Removes dynamic PT2E documentation. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Xin He <xin3.he@intel.com>
for more information, see https://pre-commit.ci
…antization, and enhance transformers-like API section Signed-off-by: Xin He <xin3.he@intel.com>
Signed-off-by: Xin He <xin3.he@intel.com>
for more information, see https://pre-commit.ci
chensuyue
approved these changes
Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

pt2e_export.pyfile and its associated export functions.__init__.pyfiles to remove references to PT2E quantization.Type of Change
feature/bug fix/documentation/validation/others
Description
detail description
Expected Behavior & Potential Risk
the expected behavior that triggered by this PR
How has this PR been tested?
how to reproduce the test (including hardware information)
Dependency Change?
any library dependency introduced or removed