fix: add cuDNN-only build option that skips the SageAttention-3 shim#367
Open
mvanhorn wants to merge 1 commit into
Open
fix: add cuDNN-only build option that skips the SageAttention-3 shim#367mvanhorn wants to merge 1 commit into
mvanhorn wants to merge 1 commit into
Conversation
Contributor
Greptile SummaryThis PR adds a cuDNN-only build option for the OmniDreams single-view native extension. The main changes are:
Confidence Score: 4/5The changed build mode needs a cache fix before merging.
integrations/omnidreams/omnidreams/native/omnidreams_singleview.py Important Files Changed
Reviews (1): Last reviewed commit: "fix: honor sage3 opt-out in native build" | Re-trigger Greptile |
| @@ -536,6 +551,7 @@ def load_extension( | |||
|
|
|||
Contributor
There was a problem hiding this comment.
When the extension has already loaded once, load_extension() returns the module-level _extension before recomputing has_sage3. A process that loads with Sage3 enabled and later sets OMNIDREAMS_SINGLEVIEW_DISABLE_SAGE3=1 still receives the Sage3-enabled binary; loading in the opposite order leaves callers with the stubbed binary after the flag is cleared.
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
Adds a build-time option to produce a cuDNN-only OmniDreams single-view native extension that skips the SageAttention-3 Blackwell shim. The heavy Sage3 path needs >62 GB in a single cudafe++ invocation even when the manifest selects the cuDNN backend and Sage3 is never used at runtime; the opt-out builds against the existing stubs instead.
Why this matters
Reported in #334. A collaborator confirmed on 2026-07-03 that current
mainstill compiles the Sage3 (and LightVAE FP8) sources unconditionally, and that the right fix is a build-time cuDNN-only / no-Sage3 mode that uses the existing Sage3 stubs and makessage3_is_built()return false. A ready-made stub translation unit already exists atintegrations/omnidreams/omnidreams_singleview/src/dit_streaming/kernels/sage3_attention_stub.cu(it definessage3_is_built() -> false,sage3_is_runtime_supported() -> false, andTORCH_CHECK(false, ...)bodies for everyrun_sage3_*entry point), but nothing wired it into the build.Changes
sage3_blackwell_api_shim.cufor the existingsage3_attention_stub.cuand drops the CUTLASS sm_120 kernel sources, so a cuDNN-only extension compiles without the >62 GB Sage3 compile. Default behavior (Sage3 built) is unchanged; the flag is opt-in.Testing
Built the extension with the opt-out flag set and confirmed the Sage3 shim and CUTLASS sm_120 sources are excluded,
sage3_is_built()returns false, and the cuDNN attention path runs. Default build still compiles Sage3.Fixes #334