Skip to content

Added alpamayo fp8-woq torch ao example - #4731

Open
micwill755 wants to merge 2 commits into
mainfrom
fp8-woq-alpamayo
Open

micwill755 wants to merge 2 commits into
mainfrom
fp8-woq-alpamayo

Conversation

@micwill755

@micwill755 micwill755 commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds a Torch-TensorRT Sphinx Gallery example for compiling the cache-independent Alpamayo 1.5 diffusion expert path with TorchAO FP8 weight-only quantization.

The example:

  • Loads the gated nvidia/Alpamayo-1.5-10B checkpoint.
  • Extracts action_in_proj -> expert -> action_out_proj into an export-friendly wrapper.
  • Applies Float8WeightOnlyConfig, keeping activations in BF16 without calibration.
  • Preserves explicit torchao.dequantize_affine operations during torch.export so Torch-TensorRT can lower them to TensorRT IDequantizeLayer operations.
  • Compiles the static expert graph with the Dynamo backend.
  • Compares eager TorchAO and TensorRT outputs.

The complete Alpamayo rollout is intentionally not exported as one graph because Hugging Face autoregressive generation, mutable KV caches, and the Python-controlled diffusion loop are dynamic. The example documents this boundary and focuses on the static diffusion expert graph.

Documentation links were added to the TorchAO examples README, the precision and quantization guide, and the Hugging Face examples index.

Motivation

Torch-TensorRT already contains TorchAO FP8 weight-only examples for linear layers and FLUX. This adds a multimodal autonomous-driving model example and demonstrates how to isolate a compilable subgraph when the complete inference pipeline contains dynamic generation and cache mutation.

Dependencies

  • Access to the gated nvidia/Alpamayo-1.5-10B Hugging Face checkpoint
  • torchao, transformers, accelerate, einops, and hydra-core
  • alpamayo1_5 from https://github.com/NVlabs/alpamayo1.5.git
  • A CUDA GPU with sufficient memory to load and compile the expert

No issue is associated with this change.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Validation

  • Python syntax validation
  • Black formatting check
  • isort import-order check
  • Ruff lint check
  • Typos check
  • Sphinx HTML documentation build with gallery execution disabled

The gated 10B model example and the full unit-test suite were not executed locally.

Checklist

  • My code follows the style guidelines of this project (you can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR so that relevant reviewers are notified

@meta-cla meta-cla Bot added the cla signed label Sep 23, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 23, 2026
@github-actions
github-actions Bot requested a review from narendasan September 23, 2026 02:10

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant