[CPU] Ship triton-cpu wheel and fix several hardcoded pin_memory=True (#52092)
Signed-off-by: jiang1.li <jiang1.li@intel.com>
This commit is contained in:
@@ -61,6 +61,7 @@ from vllm.sequence import IntermediateTensors
|
||||
from vllm.tokenizers import cached_tokenizer_from_config
|
||||
from vllm.transformers_utils.processor import cached_processor_from_config
|
||||
from vllm.utils.tensor_schema import TensorSchema, TensorShape
|
||||
from vllm.utils.torch_utils import PIN_MEMORY
|
||||
|
||||
from .blip2 import Blip2QFormerModel
|
||||
from .interfaces import (
|
||||
@@ -732,7 +733,8 @@ class GraniteSpeechForConditionalGeneration(
|
||||
target_device = self.encoder.input_linear.weight.device
|
||||
if target_device == input_features_mask.device:
|
||||
return input_features_mask
|
||||
return input_features_mask.pin_memory().to(target_device, non_blocking=True)
|
||||
masked = input_features_mask.pin_memory() if PIN_MEMORY else input_features_mask
|
||||
return masked.to(target_device, non_blocking=True)
|
||||
|
||||
def _pad_and_stack_input_features(
|
||||
self,
|
||||
|
||||
@@ -112,6 +112,7 @@ from vllm.tokenizers.registry import cached_tokenizer_from_config
|
||||
from vllm.triton_utils import HAS_TRITON, tl, triton
|
||||
from vllm.utils.collection_utils import is_list_of
|
||||
from vllm.utils.math_utils import round_up
|
||||
from vllm.utils.torch_utils import PIN_MEMORY
|
||||
from vllm.v1.worker.encoder_cudagraph_defs import EncoderCudaGraphReplayBuffers
|
||||
|
||||
from ...utils.torch_utils import async_tensor_h2d
|
||||
@@ -709,7 +710,7 @@ class Qwen3_VisionTransformer(nn.Module):
|
||||
pinned = torch.empty(
|
||||
(num_pos, pos_ids[0].shape[1]),
|
||||
dtype=pos_ids[0].dtype,
|
||||
pin_memory=True,
|
||||
pin_memory=PIN_MEMORY,
|
||||
)
|
||||
pos_ids = torch.cat(pos_ids, dim=0, out=pinned).to(
|
||||
self.device, non_blocking=True
|
||||
|
||||
Reference in New Issue
Block a user