From 0ea99798cf8cc01db6de68488caf53d2a9c2acdf Mon Sep 17 00:00:00 2001 From: Joshna Medisetty Date: Thu, 8 Oct 2026 22:36:18 +0000 Subject: [PATCH 1/5] [XPU][MAGI-2] Place the preview pipeline on the current accelerator The init gate and device string were CUDA-only, so an XPU worker raised before load. Signed-off-by: Joshna Medisetty --- vllm_omni/diffusion/models/magi2/pipeline_magi2.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vllm_omni/diffusion/models/magi2/pipeline_magi2.py b/vllm_omni/diffusion/models/magi2/pipeline_magi2.py index dc6d422a7f8..467f49084db 100644 --- a/vllm_omni/diffusion/models/magi2/pipeline_magi2.py +++ b/vllm_omni/diffusion/models/magi2/pipeline_magi2.py @@ -550,12 +550,12 @@ def __init__(self, od_config: OmniDiffusionConfig, **kwargs: object) -> None: if not od_config.model: raise ValueError("MAGI-2 requires od_config.model") _validate_native_topology(od_config) - if not current_omni_platform.is_cuda() or not current_omni_platform.is_available(): - raise RuntimeError("MAGI-2 Preview requires CUDA GPUs") + if current_omni_platform.device_type == "cpu" or not current_omni_platform.is_available(): + raise RuntimeError("MAGI-2 Preview requires an accelerator") self.od_config = od_config self.dtype = od_config.dtype or torch.bfloat16 - self.device_str = f"cuda:{torch.accelerator.current_device_index()}" + self.device_str = str(current_omni_platform.get_torch_device(torch.accelerator.current_device_index())) self.checkpoint_root = _resolve_checkpoint_root( str(od_config.model), od_config.revision, @@ -1084,8 +1084,8 @@ def forward(self, req: DiffusionRequestBatch) -> DiffusionOutput: seed = _resolve_request_seed(sampling) _seed_request(seed) - has_cuda = current_omni_platform.is_cuda() and current_omni_platform.is_available() - device_index = torch.accelerator.current_device_index() if has_cuda else None + on_accelerator = current_omni_platform.device_type != "cpu" and current_omni_platform.is_available() + device_index = torch.accelerator.current_device_index() if on_accelerator else None # Sampling reserved memory is qualification instrumentation, not part # of ordinary serving. It starts only when the pipeline profiler is # explicitly enabled, so every CUDA request avoids a 20 Hz thread. @@ -1109,7 +1109,7 @@ def forward(self, req: DiffusionRequestBatch) -> DiffusionOutput: height=height, num_inference_steps=steps, ) - if has_cuda: + if on_accelerator: torch.accelerator.synchronize() finally: if monitor_started: @@ -1120,7 +1120,7 @@ def forward(self, req: DiffusionRequestBatch) -> DiffusionOutput: video = _resize_video(video, output_width, output_height) peak_memory_mb = monitor.peak_bytes / 1024**2 if monitor is not None else 0.0 - if has_cuda and dist.is_available() and dist.is_initialized() and self._parallel_group.world_size > 1: + if on_accelerator and dist.is_available() and dist.is_initialized() and self._parallel_group.world_size > 1: peak = torch.tensor(peak_memory_mb, device=self.device_str) dist.all_reduce( peak, From 46f158bc50273754280d5aa9974c48d257ce6ee3 Mon Sep 17 00:00:00 2001 From: Joshna Medisetty Date: Tue, 13 Oct 2026 22:43:10 +0000 Subject: [PATCH 2/5] [Bugfix] Cover the MAGI-2 accelerator path in CPU tests Signed-off-by: Joshna Medisetty --- tests/diffusion/models/magi2/test_pipeline_magi2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/diffusion/models/magi2/test_pipeline_magi2.py b/tests/diffusion/models/magi2/test_pipeline_magi2.py index 280caff9783..3465e31ba15 100644 --- a/tests/diffusion/models/magi2/test_pipeline_magi2.py +++ b/tests/diffusion/models/magi2/test_pipeline_magi2.py @@ -300,8 +300,9 @@ def test_forward_stops_peak_monitor_when_initial_synchronize_fails(monkeypatch): pipe.enable_diffusion_pipeline_profiler = True monitor = Mock(peak_bytes=0) monkeypatch.setattr( - "vllm_omni.diffusion.models.magi2.pipeline_magi2.current_omni_platform.is_cuda", - lambda: True, + "vllm_omni.diffusion.models.magi2.pipeline_magi2.current_omni_platform", + "device_type", + "cuda", ) monkeypatch.setattr( "vllm_omni.diffusion.models.magi2.pipeline_magi2.current_omni_platform.is_available", From 71aaa1dd64ef170a2e766906c021c8af697bd5ad Mon Sep 17 00:00:00 2001 From: Joshna Medisetty Date: Tue, 13 Oct 2026 23:04:33 +0000 Subject: [PATCH 3/5] [Bugfix] Mark MAGI-2 supported on Intel GPU. Signed-off-by: Joshna Medisetty --- docs/models/supported_models.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/models/supported_models.md b/docs/models/supported_models.md index 63c62ad9962..c60c9d55675 100644 --- a/docs/models/supported_models.md +++ b/docs/models/supported_models.md @@ -59,7 +59,7 @@ th { | `SanaImageToVideoPipeline` | SANA-Video-2B I2V (native and Diffusers adapter validated at 480p/720p) | `Efficient-Large-Model/SANA-Video_2B_480p_diffusers`, `Efficient-Large-Model/SANA-Video_2B_720p_diffusers` | ✅︎ | | | | [Repository](https://github.com/vllm-project/vllm-omni/blob/main/recipes/NVIDIA/SANA-Video-2B.md) | | `SeedVR2Pipeline` | [SeedVR2 3B](seedvr2.md) video restoration | `ByteDance-Seed/SeedVR2-3B` | ✅︎ | | | ✅︎ | [Repository](https://github.com/vllm-project/vllm-omni/blob/main/recipes/ByteDance/SeedVR2-RTX-5090.md) | | `MiniMaxH3Pipeline` | MiniMax H3 T2VA, first/last-keyframe FL2VA, and mixed-reference Ref2VA | `MiniMaxAI/MiniMax-H3` | ✅︎ | ✅︎ | | | [Published](https://recipes.vllm.ai/MiniMaxAI/MiniMax-H3) | -| `Magi2Pipeline` | MAGI-2 native Preview-stage T2VA and I2VA (272p/540p) | `sand-ai/MAGI-2-preview` | ✅︎ | | | | [Repository](https://github.com/vllm-project/vllm-omni/blob/main/recipes/SandAI/MAGI-2-preview-L20X.md) | +| `Magi2Pipeline` | MAGI-2 native Preview-stage T2VA and I2VA (272p/540p) | `sand-ai/MAGI-2-preview` | ✅︎ | | | ✅︎ | [Repository](https://github.com/vllm-project/vllm-omni/blob/main/recipes/SandAI/MAGI-2-preview-L20X.md) | | `DreamZeroPipeline` | DreamZero-DROID | `GEAR-Dreams/DreamZero-DROID` | ✅︎ | ✅︎ | ✅︎ | ✅︎ | — | | `Pi0Pipeline` | π0 (Pi-Zero) VLA | `lerobot/pi0_base` | ✅︎ | | | | [Repository](https://github.com/vllm-project/vllm-omni/blob/main/recipes/lerobot/Pi0.md) | | `Pi05Pipeline` | π0.5 VLA | `lerobot/pi05_base` | ✅︎ | | | ✅︎ | [Repository](https://github.com/vllm-project/vllm-omni/blob/main/recipes/lerobot/Pi05.md) | From b548a8aaa64d34803c8d6d4a922e8f106c1bc358 Mon Sep 17 00:00:00 2001 From: Joshna Medisetty Date: Wed, 14 Oct 2026 20:34:54 +0000 Subject: [PATCH 4/5] [Bugfix] Keep the MAGI-2 accelerator variable name. Signed-off-by: Joshna Medisetty --- vllm_omni/diffusion/models/magi2/pipeline_magi2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vllm_omni/diffusion/models/magi2/pipeline_magi2.py b/vllm_omni/diffusion/models/magi2/pipeline_magi2.py index de9208c09ef..f3cb4b3bc68 100644 --- a/vllm_omni/diffusion/models/magi2/pipeline_magi2.py +++ b/vllm_omni/diffusion/models/magi2/pipeline_magi2.py @@ -1084,8 +1084,8 @@ def forward(self, req: DiffusionRequestBatch) -> DiffusionOutput: seed = _resolve_request_seed(sampling) _seed_request(seed) - on_accelerator = current_omni_platform.device_type != "cpu" and current_omni_platform.is_available() - device_index = torch.accelerator.current_device_index() if on_accelerator else None + has_accelerator = current_omni_platform.device_type != "cpu" and current_omni_platform.is_available() + device_index = torch.accelerator.current_device_index() if has_accelerator else None # Sampling reserved memory is qualification instrumentation, not part # of ordinary serving. It starts only when the pipeline profiler is # explicitly enabled, so ordinary GPU requests avoid a 20 Hz thread. @@ -1109,7 +1109,7 @@ def forward(self, req: DiffusionRequestBatch) -> DiffusionOutput: height=height, num_inference_steps=steps, ) - if on_accelerator: + if has_accelerator: torch.accelerator.synchronize() finally: if monitor_started: @@ -1120,7 +1120,7 @@ def forward(self, req: DiffusionRequestBatch) -> DiffusionOutput: video = _resize_video(video, output_width, output_height) peak_memory_mb = monitor.peak_bytes / 1024**2 if monitor is not None else 0.0 - if on_accelerator and dist.is_available() and dist.is_initialized() and self._parallel_group.world_size > 1: + if has_accelerator and dist.is_available() and dist.is_initialized() and self._parallel_group.world_size > 1: peak = torch.tensor(peak_memory_mb, device=self.device_str) dist.all_reduce( peak, From 8105430052f54dbecd88445441803d3645c5abbe Mon Sep 17 00:00:00 2001 From: Joshna Medisetty Date: Fri, 23 Oct 2026 19:53:16 +0000 Subject: [PATCH 5/5] [Bugfix] Patch MAGI-2 device_type through its import path Signed-off-by: Joshna Medisetty --- tests/diffusion/models/magi2/test_pipeline_magi2.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/diffusion/models/magi2/test_pipeline_magi2.py b/tests/diffusion/models/magi2/test_pipeline_magi2.py index 3465e31ba15..9870b6ef217 100644 --- a/tests/diffusion/models/magi2/test_pipeline_magi2.py +++ b/tests/diffusion/models/magi2/test_pipeline_magi2.py @@ -300,8 +300,7 @@ def test_forward_stops_peak_monitor_when_initial_synchronize_fails(monkeypatch): pipe.enable_diffusion_pipeline_profiler = True monitor = Mock(peak_bytes=0) monkeypatch.setattr( - "vllm_omni.diffusion.models.magi2.pipeline_magi2.current_omni_platform", - "device_type", + "vllm_omni.diffusion.models.magi2.pipeline_magi2.current_omni_platform.device_type", "cuda", ) monkeypatch.setattr(