fix: add cuDNN-only build option that skips the SageAttention-3 shim#367
fix: add cuDNN-only build option that skips the SageAttention-3 shim#367mvanhorn wants to merge 2 commits into
Conversation
Greptile SummaryThis PR adds a cuDNN-only build mode for the OmniDreams single-view native extension.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "fix(omnidreams): make extension cache mo..." | Re-trigger Greptile |
|
Thanks, this looks like the right direction overall. The source selection, compile flags, extension name isolation, and Sage3 availability checks all make sense to me. I think we need one cache fix before merging, though. Could you update the cache to be keyed by the extension name/build mode, or store the loaded extension’s cache key and only return it when it matches the current mode? It would also be good to add a regression test that loads once in one mode, toggles the env var, calls I think once that's done along with a rebase, we can trigger CI and attempt to merge. |
Key the _extension cache on the resolved OMNIDREAMS_SINGLEVIEW_DISABLE_SAGE3 mode so toggling it at runtime loads the correct binary instead of a stale cached one.
|
Good catch — fixed in e1bf2e0. The |
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