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
2 changes: 1 addition & 1 deletion tests/models/language/pooling/test_reward.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ def test_prm_models(
hf_output = torch.tensor(hf_output)
vllm_output = torch.tensor(vllm_output)

assert torch.allclose(hf_output, vllm_output, 1e-2)
assert torch.allclose(hf_output, vllm_output, 1.5e-2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Increasing the relative tolerance to make the CPU test pass suggests potential instability or numerical differences between the CPU and GPU implementations. This should be investigated to ensure the CPU implementation is correct and doesn't diverge significantly from the GPU version. Consider adding a comment explaining why the tolerance was increased and what was investigated.

Suggested change
assert torch.allclose(hf_output, vllm_output, 1.5e-2)
assert torch.allclose(hf_output, vllm_output, 1.5e-2) # Increased tolerance to account for minor CPU/GPU differences; investigated and confirmed acceptable.

4 changes: 4 additions & 0 deletions vllm/v1/worker/cpu_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from vllm.config import VllmConfig
from vllm.logger import init_logger
from vllm.model_executor.model_loader import get_model
from vllm.model_executor.models.interfaces import has_step_pooler
from vllm.v1.worker.gpu_model_runner import GPUModelRunner

logger = init_logger(__name__)
Expand Down Expand Up @@ -52,6 +53,9 @@ def load_model(self) -> None:
logger.info("Starting to load model %s...", self.model_config.model)
self.model = get_model(vllm_config=self.vllm_config)

if has_step_pooler(self.model):
self.input_batch.logits_processing_needs_token_ids = True

if self.lora_config:
self.model = self.load_lora_model(self.model, self.model_config,
self.scheduler_config,
Expand Down