Files
vllm-project--vllm/vllm/triton_utils/allocation.py
T
wehub-resource-sync 7ce4c8e27e
pre-commit / pre-run-check (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:55:37 +08:00

14 lines
376 B
Python

# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import torch
from vllm.triton_utils import triton
def set_triton_allocator(device: torch.device):
def alloc_fn(size: int, alignment: int, stream: int | None):
return torch.empty(size, device=device, dtype=torch.int8)
triton.set_allocator(alloc_fn)