[TPU] Deprecate xm.mark_step in favor of `torch_xla.sync (#25254)

Signed-off-by: NickLucche <nlucches@redhat.com>
Co-authored-by: Ye (Charlotte) Qi <yeq@meta.com>
This commit is contained in:
Nicolò Lucchesi
2025-09-22 10:12:57 +00:00
committed by GitHub
co-authored by Ye Qi
parent a66d131381
commit 4cf71cc88a
5 changed files with 31 additions and 29 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ from typing import TYPE_CHECKING, Optional, Union
import torch
import torch.nn.functional as F
import torch_xla.core.xla_model as xm
import torch_xla
from vllm.lora.ops.xla_ops import bgmv_expand, bgmv_expand_slice, bgmv_shrink
from vllm.lora.punica_wrapper.utils import convert_mapping
@@ -323,7 +323,7 @@ class PunicaWrapperTPU(PunicaWrapperBase):
extra_vocab_size: int,
):
# Make sure we don't accidentally collect outside operations
xm.mark_step()
torch_xla.sync()
# Pad the prompt mapping to avoid running into recompiles on the TPU
# TODO: Should this happen inside mapping internally? If so how can we