{"record":{"id":"3ee56ab535b7d07d","repo":"sgl-project/sglang","slug":"lingbot-causal-sequence-sharding-currently-require-3ee56a","errorCode":null,"errorMessage":"LingBot causal sequence sharding currently requires ulysses_degree > 1.","messagePattern":"LingBot causal sequence sharding currently requires ulysses_degree > 1\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/dits/lingbot_world.py","lineNumber":1500,"sourceCode":"        current_start: int = 0,\n        cache_start: int = 0,\n        start_frame: int = 0,\n        c2ws_plucker_emb: torch.Tensor | None = None,\n        skip_final_projection: bool = False,\n    ) -> torch.Tensor:\n        forward_batch = get_forward_context().forward_batch\n        sequence_shard_enabled = (\n            forward_batch is not None\n            and getattr(forward_batch, \"enable_sequence_shard\", False)\n            and self.sp_size > 1\n        )\n        if sequence_shard_enabled:\n            if get_ring_parallel_world_size() > 1:\n                raise NotImplementedError(\n                    \"LingBot causal sequence sharding currently supports ulysses_degree > 1 with ring_degree = 1 only.\"\n                )\n            if get_ulysses_parallel_world_size() <= 1:\n                raise NotImplementedError(\n                    \"LingBot causal sequence sharding currently requires ulysses_degree > 1.\"\n                )\n        orig_dtype = hidden_states.dtype\n        if not isinstance(encoder_hidden_states, torch.Tensor):\n            encoder_hidden_states = encoder_hidden_states[0]\n        if (\n            isinstance(encoder_hidden_states_image, list)\n            and len(encoder_hidden_states_image) > 0\n        ):\n            encoder_hidden_states_image = encoder_hidden_states_image[0]\n        else:\n            encoder_hidden_states_image = None\n\n        batch_size, _, num_frames, height, width = hidden_states.shape\n        p_t, p_h, p_w = self.patch_size\n        post_patch_num_frames = num_frames // p_t\n        post_patch_height = height // p_h\n        post_patch_width = width // p_w","sourceCodeStart":1482,"sourceCodeEnd":1518,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/dits/lingbot_world.py#L1482-L1518","documentation":"Sequence sharding in LingBot requires Ulysses degree > 1 — with degree 1 there is nothing to shard and the sharded code path (all-to-all packing, split handling) is not valid. If enable_sequence_shard is set with sp_size > 1 but the Ulysses group turns out to be size 1, the model refuses.","triggerScenarios":"forward_batch.enable_sequence_shard=True and self.sp_size > 1 while get_ulysses_parallel_world_size() == 1, e.g. SP configured via a different mechanism than the Ulysses group.","commonSituations":"Setting sp_size through one flag but initializing Ulysses groups elsewhere (partial init); leftover enable_sequence_shard from a previous config; env vars for ulysses not propagated to workers.","solutions":["Ensure Ulysses parallel groups are initialized before forward (correct launch flags/env) so world size matches sp_size","Unset enable_sequence_shard if you actually intend a single-rank or non-Ulysses run","Align sp_size with the Ulysses degree in server args"],"exampleFix":"# before\nbatch.enable_sequence_shard = True   # ulysses group size is 1\n\n# after\nbatch.enable_sequence_shard = False  # or launch with --ulysses-size matching sp_size","handlingStrategy":"validation","validationCode":"uly = get_ulysses_parallel_world_size()\\nif getattr(forward_batch, 'enable_sequence_shard', False) and uly <= 1:\\n    forward_batch.enable_sequence_shard = False","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify Ulysses group init before setting shard flags","Propagate ulysses env vars to all workers","Log world sizes once at startup"],"tags":["sequence-parallelism","config-mismatch","lingbot"],"backgroundTag":"parallel-degree-not-divisible","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}