{"record":{"id":"452c634436ff5861","repo":"sgl-project/sglang","slug":"sana-wm-streaming-does-not-support-cfg-parallel-r","errorCode":null,"errorMessage":"SANA-WM streaming does not support CFG parallel; run replicated.","messagePattern":"SANA-WM streaming does not support CFG parallel; run replicated\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/sana_wm/streaming.py","lineNumber":451,"sourceCode":"        *,\n        device: torch.device,\n        target_dtype: torch.dtype,\n        iload=None,\n    ):\n        \"\"\"Resolve sampler config + text/camera conditioning (shared by the offline loop and realtime path).\"\"\"\n        pcfg = server_args.pipeline_config\n        sampler_cfg = SanaWMSelfForcingSamplerConfig.from_pipeline_config(pcfg)\n        explicit_sigmas = SanaWMSelfForcingSampler.build_per_chunk_sigmas(\n            sampler_cfg.denoising_step_list\n        )\n\n        # Streaming uses its OWN cfg scale (official StreamingGenerationConfig.cfg_scale=1.0\n        # => no CFG on the distilled 4-step model). The general guidance_scale (e.g. 4.5)\n        # is for the dense path; using it here ran CFG=4.5 vs the reference's none.\n        cfg_scale = sampler_cfg.streaming_cfg_scale\n        do_cfg = bool(batch.do_classifier_free_guidance) and cfg_scale > 1.0\n        if server_args.enable_cfg_parallel and do_cfg:\n            raise NotImplementedError(\n                \"SANA-WM streaming does not support CFG parallel; run replicated.\"\n            )\n\n        # --- text conditioning ---\n        pos_embeds = _to_device_dtype(\n            _first_tensor(pcfg.get_pos_prompt_embeds(batch)),\n            device=device,\n            dtype=target_dtype,\n        )\n        pos_mask = _to_device_dtype(\n            _first_tensor(batch.prompt_attention_mask), device=device\n        )\n        if pos_embeds is None:\n            raise ValueError(\"SANA-WM streaming requires positive prompt embeds.\")\n        neg_embeds = neg_mask = None\n        if do_cfg:\n            neg_embeds = _to_device_dtype(\n                _first_tensor(pcfg.get_neg_prompt_embeds(batch)),","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/sana_wm/streaming.py#L433-L469","documentation":"Streaming SANA-WM uses its own streaming_cfg_scale (officially 1.0, i.e. no CFG on the distilled 4-step model). If classifier-free guidance is requested (do_classifier_free_guidance and cfg_scale > 1.0) while enable_cfg_parallel is on, the streaming path raises NotImplementedError because CFG-parallel sharding is not implemented for it.","triggerScenarios":"Launching the server with --enable-cfg-parallel together with a streaming_cfg_scale > 1.0 and CFG-flagged requests.","commonSituations":"Reusing dense-path server flags (guidance_scale ~4.5 + CFG parallel) on a streaming deployment; a client toggling do_classifier_free_guidance on realtime requests.","solutions":["Disable CFG parallel for streaming runs (run replicated)","Keep streaming_cfg_scale at 1.0 so do_cfg is False and the check never trips","Route CFG-hungry requests to the dense/offline path instead of streaming"],"exampleFix":"# before\nserver_args.enable_cfg_parallel = True\nserver_args.pipeline_config.sampler.streaming_cfg_scale = 4.5\n# after\nserver_args.enable_cfg_parallel = False\nserver_args.pipeline_config.sampler.streaming_cfg_scale = 1.0","handlingStrategy":"fallback","validationCode":"do_cfg = bool(batch.do_classifier_free_guidance) and cfg_scale > 1.0\nassert not (server_args.enable_cfg_parallel and do_cfg), \"streaming + CFG parallel unsupported\"","typeGuard":"null","tryCatchPattern":"try:\n    resp = stage.forward(batch, server_args)\nexcept NotImplementedError:\n    server_args.enable_cfg_parallel = False\n    resp = stage.forward(batch, server_args)  # rerun replicated","preventionTips":["Keep streaming deployments on streaming_cfg_scale=1.0","Don't reuse dense-path flags blindly on streaming servers","Add a startup assertion combining cfg-parallel and streaming config"],"tags":["sana-wm","streaming","cfg-parallel","notimplementederror","server-args"],"backgroundTag":"unsupported-feature-combination","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}