Skip to content

fix(modular_pipeline): include Ascend NPU in device-type offload guards - #14786

Open
li-lizhe wants to merge 1 commit into
huggingface:mainfrom
li-lizhe:fix/modular-pipeline-npu-offload
Open

li-lizhe wants to merge 1 commit into
huggingface:mainfrom
li-lizhe:fix/modular-pipeline-npu-offload

Conversation

@li-lizhe

Copy link
Copy Markdown

The sequential offload conflict check (line 2691) and model offload warning (line 2704) in Pipeline.to() only applied to CUDA and Intel XPU devices. Ascend NPU is also an accelerator where moving a pipeline to the device conflicts with offloading — users calling .to("npu") should get the same clear error/warning instead of silently broken behavior.

Changes:

  • ["cuda", "xpu"]["cuda", "xpu", "npu"] at two guard points (lines 2691 and 2704)

Effect:

device_type Old guard New guard
"cuda" YES YES
"xpu" YES YES
"npu" NO YES
"cpu" NO NO
"hpu" NO NO

2 insertions(+), 2 deletions(-) — clean, minimal, device-agnostic.

Verified on Ascend 910B NPU: device_type='npu' now correctly captured by the guard list.

The sequential offload conflict check and model offload warning in
`Pipeline.to()` only applied to CUDA and Intel XPU devices. Ascend NPU
is also an accelerator where moving a pipeline to the device conflicts
with offloading — users calling `.to("npu")` should get the same
clear error/warning instead of silently broken behavior.

5 changes, 2 insertions(+), 2 deletions(-) — adds "npu" to the
device_type lists at lines 2691 and 2704 (previously ["cuda", "xpu"]).
@github-actions github-actions Bot added modular-pipelines size/S PR with diff < 50 LOC labels Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modular-pipelines size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant