[NPU] Fix device mismatch in SWA mask for DSpark verify graph capture (#39353)
This commit is contained in:
@@ -802,7 +802,8 @@ class AscendAttnBackend(AttentionBackend):
|
|||||||
and _is_dflash_verify(spec_info)
|
and _is_dflash_verify(spec_info)
|
||||||
and seq_lens_cpu is not None
|
and seq_lens_cpu is not None
|
||||||
):
|
):
|
||||||
seq_lens_int = seq_lens_cpu[:bs].int()
|
# seq_lens_cpu may be a CPU tensor; swa_indices is on-device.
|
||||||
|
seq_lens_int = seq_lens_cpu[:bs].int().to(self.device)
|
||||||
else:
|
else:
|
||||||
seq_lens_int = seq_lens[:bs].int()
|
seq_lens_int = seq_lens[:bs].int()
|
||||||
starts = torch.clamp(seq_lens_int - self.sliding_window_size, min=0)
|
starts = torch.clamp(seq_lens_int - self.sliding_window_size, min=0)
|
||||||
|
|||||||
Reference in New Issue
Block a user