{"record":{"id":"cf637d119e9aaadd","repo":"invoke-ai/InvokeAI","slug":"pixdit-t2i-context-parallel-is-not-implemented-for","errorCode":null,"errorMessage":"PixDiT_T2I context parallel is not implemented for the encoder-decoder path. Build with enable_ed=False to use CP.","messagePattern":"PixDiT_T2I context parallel is not implemented for the encoder-decoder path\\. Build with enable_ed=False to use CP\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/pid/_src/networks/pixeldit_official.py","lineNumber":1354,"sourceCode":"\n        # Context-parallel state — set by `enable_context_parallel`. The base\n        # class does not split tokens itself; subclasses (e.g. PidNet)\n        # are responsible for splitting along L in `forward` and gathering\n        # before the final fold. This attribute is propagated to every patch\n        # block (joint MMDiT attention) and pixel block (RotaryAttention).\n        self._cp_group: Optional[ProcessGroup] = None\n        self._is_context_parallel_enabled: bool = False\n\n    @property\n    def is_context_parallel_enabled(self) -> bool:\n        return self._is_context_parallel_enabled\n\n    def enable_context_parallel(self, cp_group: ProcessGroup):\n        # CP for the ED (encoder-decoder) path is not implemented; refuse to\n        # enable CP if the network was built with use_ed=True so we don't\n        # silently produce wrong results.\n        if self.use_ed:\n            raise NotImplementedError(\n                \"PixDiT_T2I context parallel is not implemented for the encoder-decoder path. \"\n                \"Build with enable_ed=False to use CP.\"\n            )\n        for block in self.patch_blocks:\n            block.set_context_parallel_group(cp_group)\n        for block in self.pixel_blocks:\n            block.set_context_parallel_group(cp_group)\n        self._cp_group = cp_group\n        self._is_context_parallel_enabled = True\n\n    def disable_context_parallel(self):\n        for block in self.patch_blocks:\n            block.set_context_parallel_group(None)\n        for block in self.pixel_blocks:\n            block.set_context_parallel_group(None)\n        self._cp_group = None\n        self._is_context_parallel_enabled = False\n","sourceCodeStart":1336,"sourceCodeEnd":1372,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/pid/_src/networks/pixeldit_official.py#L1336-L1372","documentation":"Context parallelism (CP, sharding sequence across GPUs) is only implemented for the non-ED path of PixDiT_T2I. enable_context_parallel refuses to enable CP on a network built with use_ed=True by raising NotImplementedError, because silently running CP on the encoder-decoder path would produce wrong results. The guard exists so misconfiguration fails loudly at setup rather than corrupting outputs.","triggerScenarios":"Calling net.enable_context_parallel(cp_group) (via _maybe_enable_cp_on_nets) on a PixDiT_T2I instantiated with enable_ed=True.","commonSituations":"Multi-GPU launch scripts that always enable CP, combined with a config that enables the ED super-resolution path; a change of backbone config without updating the parallelism setup.","solutions":["Rebuild the model with enable_ed=False if CP is required","Or run the ED-path model without context parallelism (single-process / plain DDP)","Request/implement CP support for the ED path upstream"],"exampleFix":"// before\nnet = build_model(enable_ed=True)\nnet.enable_context_parallel(cp_group)\n// after\nnet = build_model(enable_ed=False)  # CP-compatible path\nnet.enable_context_parallel(cp_group)","handlingStrategy":"validation","validationCode":"if getattr(net, \"use_ed\", False):\n    raise RuntimeError(\"CP requires enable_ed=False\")","typeGuard":null,"tryCatchPattern":"try:\n    net.enable_context_parallel(cp_group)\nexcept NotImplementedError:\n    logger.warning(\"Skipping CP: ED path enabled\")","preventionTips":["Check use_ed before parallel setup","Centralize distributed config validation","Log model flags at launcher startup"],"tags":["context-parallel","not-implemented","multi-gpu","configuration-conflict"],"backgroundTag":"feature-not-implemented-parallelism","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}