flashdreams.accelerated API v0 - #486
Conversation
Greptile SummaryThe PR introduces reusable accelerated quantization and multi-head-attention primitives, integrates selectable optimized attention backends into Omnidreams, and adds benchmark tooling.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. The previously reported stale-derived-weight defect is addressed by rebuilding fused and quantized projections in a registered post-load hook after canonical checkpoint tensors are loaded. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Omnidreams checkpoint] --> B[Canonical Q/K/V parameters]
B --> C[Post-load refresh hook]
C --> D[Non-persistent fused or quantized weights]
D --> E[Optimized attention backend]
E --> F[Autoregressive rollout]
Reviews (25): Last reviewed commit: "Fixed rope latex format" | Re-trigger Greptile |
3077d4d to
b2685be
Compare
ArielG-NV
left a comment
There was a problem hiding this comment.
Question on inclusion of file
fc4b03f to
f63a088
Compare
4ad51b5 to
97dfa44
Compare
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); |
There was a problem hiding this comment.
I guess we should restrict the license header stuff to just the first 2 lines, no need for the rest.
There was a problem hiding this comment.
As all the source code in this project are putting full license header. You may want to submit a new issue to change the AGENT.md for this over the project. This is outside the scope of this PR.
There was a problem hiding this comment.
I am not sure this is true. We originally used the longer style although switched to the shorter style based on some internal guidance and that is mainly the style that newer changes have used. The split is probably around 50/50 overall for flashdreams at this point. I guess I will do a general license cleanup later to capture stuff like this. I think my preference would be if newer files did not use the longer style if we know we will definitely change it. The skill file probably needs to be updated.
- Require all bias to be present or omit for qkv projection - For cross attention, rope slicing will slice the first x.shape[-2] rope freqencies
I'll compose a formal documentation on |
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
|
/ok to test b032f75 |
|
I've just realized CUDA graph really don't like the fp8 cudnn in flashdreams/flashdreams/accelerated/multi_head_attention/cudnn/native_fp8.py I need to fix it... |
|
/ok to test 9e809fb |
|
/ok to test f88c93c |
|
/ok to test 9e44fb0 |
fix: rename optimized multi-head attention docs: expand accelerated toolkit guide docs: normalize accelerated math delimiters docs: clarify quantizer configuration docs: simplify accelerated quantizer granularity docs: clarify accelerated quantizer formats docs: clarify accelerated dequantization
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
|
|
There was a problem hiding this comment.
Would it make sense to add a mermaid diagram or two to this file? A single left-to-right figure from projection through Q/K norm, RoPE, cache write, and SDPA, with each OptimizedImplConfig knob annotated at the stage it controls, would show how these stages relate in a way the per-knob bullets can't, and would make BEFORE_KV_CACHE vs AFTER_KV_CACHE obvious at a glance. The derived-weight lifecycle in the integration section might be worth one too.
Add FlashDreams accelerated primitives and integrate them with Omnidreams
Summary
Introduce reusable quantization and optimized multi-head attention primitives under
flashdreams.accelerated, integrate them with Omnidreams, and add reproducible performance benchmarks and plotting tools.1.
flashdreams.accelerated1.1 Quantization toolkit
state_dict, preserving source checkpoint compatibility.1.2 Optimized MHA
BlockKVCacheand preserve caller-managed cache lifecycles.2. Integration: Omnidreams
omnidreams-triton-fa2omnidreams-cuda-cudnnomnidreams-cuda-spargeomnidreams-cuda-sage3fp812.0a3. Benchmark and plot scripts
pytest-benchmarkconfiguration and dependencies.Testing
The change includes CPU, GPU, and manual benchmark coverage. GPU validation requires a supported NVIDIA GPU; the optimized MHA path requires compute capability 9.0 or newer.
Generated benchmark JSON and figures are intentionally not committed.