Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Fix 2 Node and Spec Decode tests #13341

Merged
merged 6 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions tests/distributed/test_pipeline_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,11 @@ def _compare_tp(
if load_format == "dummy":
# Avoid OOM
text_overrides = {
"hidden_size": 512,
"intermediate_size": 800,
"num_layers": 1,
"num_hidden_layers": 1,
"num_attention_heads": tp_size * pp_size,
"num_experts": 2,
"num_experts_per_tok": 2,
"num_local_experts": 2,
Expand Down
16 changes: 12 additions & 4 deletions vllm/spec_decode/ngram_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import torch
import torch.nn as nn

from vllm.config import VllmConfig
from vllm.model_executor.layers.sampler import SamplerOutput
from vllm.sequence import ExecuteModelRequest
from vllm.spec_decode.interfaces import SpeculativeProposals
Expand All @@ -25,11 +26,18 @@ class NGramWorker(NonLLMProposerWorkerBase):
which don't rely on LLM model to give proposals.
"""

def __init__(self, *args, **kwargs):
def __init__(
self,
vllm_config: VllmConfig,
local_rank: int,
device_type: str = "cuda",
**kwargs,
):
super().__init__(vllm_config)

# Get local_rank/vocab_size from kwargs attribute
self.local_rank = kwargs["local_rank"]
self.vocab_size = kwargs["vllm_config"].model_config.get_vocab_size()
self.device_type = kwargs.get("device_type", "cuda")
self.local_rank = local_rank
self.device_type = device_type

# Lazy initialization list.
self._proposer: Top1Proposer
Expand Down