Skip to content

feat: add extra_parallel_kwargs for model-specific CP options - #1110

Merged
DefTruth merged 3 commits into
mainfrom
dev
Sep 2, 2026
Merged

DefTruth merged 3 commits into
mainfrom
dev

Conversation

@DefTruth

@DefTruth DefTruth commented Sep 2, 2026

Copy link
Copy Markdown
Member

ParallelismConfig gains an extra_parallel_kwargs dict (distinct from the deprecated parallel_kwargs, which maps to standard config fields). Its entries are opaque to cache-dit and forwarded to
_ContextParallelConfig.extra_kwargs on both transformer and controlnet dispatch, letting downstream model hooks read custom toggles, e.g. {"boogu_double_stream_cp": False} to opt out of fast-boogu's default-on double-stream CP wrapper.

DefTruth and others added 3 commits September 2, 2026 02:44
…tions

ParallelismConfig gains an extra_parallel_kwargs dict (distinct from the
deprecated parallel_kwargs, which maps to standard config fields). Its
entries are opaque to cache-dit and forwarded to
_ContextParallelConfig.extra_kwargs on both transformer and controlnet
dispatch, letting downstream model hooks read custom toggles, e.g.
{"boogu_double_stream_cp": False} to opt out of fast-boogu's
default-on double-stream CP wrapper.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
All async Ulysses processor wrappers (flux, flux2, qwen_image, zimage,
zimage_controlnet, ovis_image, longcat_image) entered the async path on
`cp_config.ulysses_degree > 1` alone. Because the class-level patch is
process-wide and cannot be unpatched, any second instance of the same
processor class with CP enabled but ulysses_async=False (e.g. klein-ht
and klein-fit, two Flux2Transformer2DModel instances in one worker) was
forced onto the async path once any instance opted in.

Gates now also require getattr(cp_config, "ulysses_async", False),
matching the fast-boogu hooks gate semantics, so per-instance opt-in
works as documented.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The flux2 async wrappers constructed _All2AllComm and called
send_q/k/v/o + handle.wait() inline. Under torch.compile these
comm-induced graph breaks push the surrounding fp8 Linear calls
(torchao per-row subclass) into nested resume frames, where torchao's
_dispatch__torch_function__ CONTAINS_OP crashes dynamo with
"Polyfill handler does not have a traceable function"
(reproduced with fast-boogu klein fp8 + compile + ulysses_async).

Route all comm construction/launches/waits through a new _AsyncA2A
helper whose three methods are @torch.compiler.disable, making them
opaque in-graph calls that do not break the graph; projections, norms,
rope and the attention dispatch remain traceable. Mirrors the
fast-boogu async launcher pattern.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@DefTruth
DefTruth merged commit 8987d3d into main Sep 2, 2026
4 checks passed
@DefTruth
DefTruth deleted the dev branch September 2, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant