vllm_omni.diffusion.offloader.module_collector ¶
ModuleDiscovery ¶
Discovers pipeline components.
If the pipeline implements :class:SupportsComponentDiscovery, its _dit_modules, _encoder_modules, and _vae_modules class variables are used directly. Otherwise, falls back to scanning well-known attribute names.
discover staticmethod ¶
discover(pipeline: Module) -> PipelineModules
Discover DiT, encoder, and VAE modules from pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline | Module | Diffusion pipeline model | required |
Returns:
| Type | Description |
|---|---|
PipelineModules | PipelineModules with lists of discovered modules and names |
PipelineModules dataclass ¶
resident_modules class-attribute instance-attribute ¶
resident_names class-attribute instance-attribute ¶
outermost_dits ¶
Discovered DiTs that are not nested inside another discovered DiT.
Some pipelines declare a DiT and one of its own submodules as separate DiTs (e.g. Cosmos3 lists both transformer and the nested transformer.language_model) so that offloading can treat them as independent rings. HSDP instead shards each DiT through that DiT's own _hsdp_shard_conditions; an inner DiT's blocks are already covered by its ancestor's conditions, so sharding it again would double-wrap them (and the inner stack may not declare conditions at all). Keeping only the outermost DiTs leaves the ancestor's conditions as the single source of truth for every nested block. Order follows dit_names.