Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions vllm_ascend/ops/register_custom_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _maybe_prefetch_mlp_gate_up_proj_impl(x_dependency: torch.Tensor,
except AssertionError:
return

if not forward_context.prefetch_mlp_enabled:
if not getattr(forward_context, 'prefetch_mlp_enabled', False):
return
model_instance = forward_context.model_instance
prefetch_stream = forward_context.prefetch_stream
Expand Down Expand Up @@ -173,7 +173,7 @@ def _maybe_prefetch_mlp_down_proj_impl(x_dependency: torch.Tensor) -> None:
except AssertionError:
return

if not forward_context.prefetch_mlp_enabled:
if not getattr(forward_context, 'prefetch_mlp_enabled', False):
return
forward_context.prefetch_mlp_down_proj = True
model_instance = forward_context.model_instance
Expand Down Expand Up @@ -202,7 +202,7 @@ def _maybe_wait_prefetch_done_impl(x: torch.Tensor) -> None:
except AssertionError:
return

if not forward_context.prefetch_mlp_enabled:
if not getattr(forward_context, 'prefetch_mlp_enabled', False):
return
if forward_context.prefetch_mlp_gate_up_proj or \
forward_context.prefetch_mlp_down_proj:
Expand Down
8 changes: 1 addition & 7 deletions vllm_ascend/patch/worker/patch_qwen2_5_omni.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
import torch
import torch.nn as nn
from vllm.model_executor.models.qwen2_5_omni_thinker import (
Qwen2_5_VLImageInputs, Qwen2_5_VLVideoInputs,
Qwen2_5OmniThinkerForConditionalGeneration)
Qwen2_5_VLImageInputs, Qwen2_5_VLVideoInputs)

from vllm_ascend.ascend_forward_context import set_ascend_forward_context

Expand Down Expand Up @@ -65,8 +64,3 @@ def _process_video_input(
sizes = grid_thw.prod(-1) // merge_size // merge_size

return video_embeds.split(sizes.tolist())


# NOTE: These will be removed after ascend_forward_context is refactored.
Qwen2_5OmniThinkerForConditionalGeneration._process_image_input = AscendQwen2_5OmniThinkerForConditionalGeneration._process_image_input
Qwen2_5OmniThinkerForConditionalGeneration._process_video_input = AscendQwen2_5OmniThinkerForConditionalGeneration._process_video_input
10 changes: 3 additions & 7 deletions vllm_ascend/patch/worker/patch_qwen2_5_vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import torch.nn as nn
import torch.nn.functional as F
import torch_npu
from vllm.model_executor.models.qwen2_5_vl import (
Qwen2_5_VisionAttention, Qwen2_5_VLForConditionalGeneration,
Qwen2_5_VLImageInputs, Qwen2_5_VLVideoInputs)
from vllm.model_executor.models.qwen2_5_vl import (Qwen2_5_VisionAttention,
Qwen2_5_VLImageInputs,
Qwen2_5_VLVideoInputs)
from vllm.model_executor.models.qwen2_vl import Qwen2VisionAttention
from vllm.model_executor.models.vision import run_dp_sharded_mrope_vision_model

Expand Down Expand Up @@ -169,7 +169,3 @@ def _process_video_input(
# NOTE: This will be removed after MMEncoderAttention has been extract as a CustomOp in vllm.
Qwen2VisionAttention.forward = AscendQwen2_5_VisionAttention.forward
Qwen2_5_VisionAttention.forward = AscendQwen2_5_VisionAttention.forward

# NOTE: These will be removed after ascend_forward_context is refactored.
Qwen2_5_VLForConditionalGeneration._process_image_input = AscendQwen2_5_VLForConditionalGeneration._process_image_input
Qwen2_5_VLForConditionalGeneration._process_video_input = AscendQwen2_5_VLForConditionalGeneration._process_video_input
Loading