Feat: Attention Smoothing to Improve Generation Quality - #40
Open
Uxito-Ada wants to merge 5 commits into
Open
Conversation
Collaborator
|
It's better to add some comparison videos. |
Uxito-Ada
marked this pull request as draft
September 2, 2026 02:08
Uxito-Ada
force-pushed
the
feat/fp8-sol-attention-quality
branch
from
September 8, 2026 01:30
7de42e9 to
41cc667
Compare
Use repository URLs for benchmark artifacts that live outside the MkDocs documentation tree, so cookbook link validation can resolve them.
Record rebased H100 measurements for performance, real-H3 attention-boundary error, synchronized video and audio metrics, and current-shape fusion timings. Keep the bilingual smoothing claims aligned with the measured two-run overhead.
Uxito-Ada
marked this pull request as ready for review
September 9, 2026 01:13
Collaborator
|
KV smoothing can be enabled by default, eliminating the need for command-line arguments and simplifying example configurations. |
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.
Summary
Follow up on #35 by improving MiniMax-H3 FP8 Sol-Attn quality with attention-equivalent K/V sequence-mean smoothing.
On the H100 MiniMax-H3, the final profile reduces attention-output MSE by 8.18% versus unsmoothed FP8 Sol, remains 39.4% faster than BF16, and uses 42.6% less peak allocated GPU memory.
Changes
This is attention smoothing, not SmoothQuant, where no scale is migrated between Linear activations and weights.
MiniMax-H3: Unsmoothed vs Smoothed FP8 Sol
Workload: 1 x H100 80GB, no TP/SP, FL2VA T2VA 1344x768, 4 seconds / 107 decoded frames at 24 fps, 50 denoising steps, seed 0, exact Sol threshold, 10 dense steps, 2 dense layers, cold processes without warm-up, and MP4 serialization excluded from generation timing. Each FP8 profile was measured twice.
Prompt:
Performance overview
Generated Output Comparison
BF16 Linear + FlashAttention 4
bf16_fa4.mp4
FP8 Linear + FP8 Sol, no smoothing
fp8_sol_unsmoothed.mp4
FP8 Linear + FP8 Sol, KV smoothing + V correction
fp8_sol_smoothed.mp4
Quantitative analysis, against the same-seed BF16 output:
Smoothing improves every reported video metric.
Smooth Attention Kernel Accuracy
Measurement setup:
(1, 32626, 56, 128)Dense-attention output cosine improves from 0.999403 to 0.999452, relative L2 error from 0.03455 to 0.03311, and SQNR from 29.23 to 29.60 dB. Q is intentionally unchanged by smoothing.
Testing
GitHub CI also passes lint, build, server tests, and unit tests on Python 3.10, 3.11, and 3.12.
Architecture Support