{"record":{"id":"1bbcd9ffd99c9bf7","repo":"sgl-project/sglang","slug":"component-component-name-r-resolved-to-component","errorCode":null,"errorMessage":"Component {component_name!r} resolved to component-offload, but it was loaded as an FSDP-managed module","messagePattern":"Component (.+?) resolved to component-offload, but it was loaded as an FSDP-managed module","errorType":"validation","errorClass":"ComponentResidencyError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/managers/memory_managers/component_manager.py","lineNumber":91,"sourceCode":"    _stage_name_mapping: Mapping[str, ComponentResidencyStage]\n    component_residency_strategies: MutableMapping[str, \"ComponentResidencyStrategy\"]\n\n\ndef build_component_residency_strategy(\n    component_name: str,\n    module: nn.Module,\n    server_args: ServerArgs,\n) -> ComponentResidencyStrategy:\n    residency_mode = server_args.residency_mode(component_name)\n    if is_layerwise_offloaded_module(module):\n        return LayerwiseOffloadStrategy()\n    if residency_mode == LAYERWISE_OFFLOAD:\n        raise ComponentResidencyError(\n            f\"Component {component_name!r} resolved to layerwise-offload, but its \"\n            \"loaded module did not enable layerwise offload\"\n        )\n    if residency_mode == COMPONENT_OFFLOAD and is_fsdp_managed_module(module):\n        raise ComponentResidencyError(\n            f\"Component {component_name!r} resolved to component-offload, but it \"\n            \"was loaded as an FSDP-managed module\"\n        )\n    if (\n        not current_platform.is_mps()\n        and not is_fsdp_managed_module(module)\n        and residency_mode == COMPONENT_OFFLOAD\n    ):\n        return ComponentOffloadStrategy()\n    return ResidentStrategy()\n\n\nclass ComponentResidencyManager:\n    \"\"\"Coordinate component placement over a sequential request timeline.\"\"\"\n\n    def __init__(\n        self, pipeline: ComponentResidencyPipeline, server_args: ServerArgs\n    ) -> None:","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/managers/memory_managers/component_manager.py#L73-L109","documentation":"If the resolved residency mode for a component is component-offload but the module was loaded as FSDP-managed, the strategy builder raises: FSDP sharding already manages parameter placement, so per-component CPU offload on top of it is not supported.","triggerScenarios":"residency_mode == COMPONENT_OFFLOAD and is_fsdp_managed_module(module) is true — e.g. running with FSDP enabled and a residency config assigning \"*=component-offload\" or a specific FSDP-wrapped component to component-offload.","commonSituations":"Enabling FSDP for multi-GPU sharding while keeping a pre-existing --component-residency / legacy CPU-offload flag that worked in the non-FSDP setup.","solutions":["Remove the component-offload assignment for FSDP-managed components (let FSDP handle placement)","Switch those components to layerwise-offload or gpu mode in the residency config","Disable FSDP if per-component CPU offload is the hard requirement"],"exampleFix":"# before\n--enable-fsdp --component-residency *=component-offload\n# after\n--enable-fsdp --component-residency *=layerwise-offload","handlingStrategy":"validation","validationCode":"from sglang.multimodal_gen.runtime.managers.memory_managers.component_manager import is_fsdp_managed_module\nif is_fsdp_managed_module(module):\n    assert mode != \"component-offload\", \"FSDP modules cannot use component-offload\"","typeGuard":"def allows_component_offload(module) -> bool:\n    return not is_fsdp_managed_module(module)","tryCatchPattern":null,"preventionTips":["Decide upfront whether FSDP sharding or manual component offload owns memory placement"],"tags":["memory","offload","fsdp","component-residency","config"],"backgroundTag":"conflicting-config-options","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}