Added TorchAO FP8 weight-only and static quantization + user guides - #4589
Open
micwill755 wants to merge 1 commit into
Open
Added TorchAO FP8 weight-only and static quantization + user guides#4589micwill755 wants to merge 1 commit into
micwill755 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/conversion/test_cumsum_aten.py 2026-08-26 08:29:50.568560+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/conversion/test_cumsum_aten.py 2026-08-26 08:30:14.958586+00:00
@@ -31,13 +31,11 @@
immutable_weights=False,
use_dynamo_tracer=True,
)
return
- self.run_test(
- Cumsum(), inputs, immutable_weights=False, use_dynamo_tracer=True
- )
+ self.run_test(Cumsum(), inputs, immutable_weights=False, use_dynamo_tracer=True)
@parameterized.expand(
[
((3, 1), 0),
((3, 1), 1),
@@ -106,14 +104,11 @@
has_static_trip_count = (
min_shape[positive_dim]
== opt_shape[positive_dim]
== max_shape[positive_dim]
)
- if (
- has_static_trip_count
- and not is_tensorrt_rtx_version_supported("1.7")
- ):
+ if has_static_trip_count and not is_tensorrt_rtx_version_supported("1.7"):
with self.assertRaises(UnsupportedOperatorException):
self.run_test_with_dynamic_shape(
Cumsum(),
inputs,
immutable_weights=False,
This was referenced Aug 26, 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.
Description
Adds TorchAO FP8 support to the Dynamo path: weight-only (
dequantize_affine→ TensorRTIDequantizeLayer) and static FP8 (non-decomposedquantize_affine_float8/dequantize_affine_float8). Constant folding is updated so those DQ ops stay in the graph and are not folded into dense BF16/FP16 weights.This matches the existing ModelOpt INT8/FP8/FP4 QDQ flow, but for TorchAO tensor-subclass checkpoints. Examples cover a toy
nn.Linear(WOQ and static) and FLUX.1-dev WOQ. User-guide, troubleshooting, and gallery docs are updated. HTML underdocs/is left to the post-merge docgen bot.Dependencies:
torchao(examples list it inexamples/dynamo/requirements.txt). FP8 compile/runtime needs Hopper or newer (compute capability ≥ 9).Replaces #4577 (same commits; reopened from
pytorch/TensorRTbranches so GitHub native Stacks work). INT4 follow-up is #4590 (2/2).Fixes # (issue)
Type of change
Checklist: