[Platform] Fill in the missing backend parameter for torch.compile (#51781)

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
This commit is contained in:
wangxiyuan
2026-08-19 10:31:19 +00:00
committed by GitHub
parent eac636a7fa
commit cba06764d7
5 changed files with 15 additions and 9 deletions
+1 -1
View File
@@ -338,7 +338,7 @@ class TopKTopPSampler(nn.Module):
# Note: this is a workaround for
# https://github.com/pytorch/pytorch/pull/151218
@torch.compile(dynamic=True)
@torch.compile(dynamic=True, backend=current_platform.simple_compile_backend)
def compiled_random_sample(logits: torch.Tensor) -> torch.Tensor:
probs = logits.softmax(dim=-1, dtype=torch.float32)
q = torch.empty_like(probs)