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/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def remote_openai_server(request):

if 'tp_size' in params:
tp_size = params['tp_size']
skip_unsupported_tp_size(int(tp_size))
skip_unsupported_tp_size(int(tp_size), backend)
server_args.extend(["--tensor-parallel-size", str(tp_size)])

try:
Expand Down
5 changes: 3 additions & 2 deletions tests/e2e/test_spyre_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
pytest.param(2, marks=pytest.mark.multi),
pytest.param(4, marks=pytest.mark.multi),
pytest.param(8, marks=pytest.mark.multi),
])
],
ids=lambda val: f"TP({val})")
@pytest.mark.parametrize("backend", get_spyre_backend_list())
def test_output(
model: str,
Expand All @@ -45,7 +46,7 @@ def test_output(
After debugging, DISABLE_ASSERTS should be reset to 'False'.
'''

skip_unsupported_tp_size(tp_size)
skip_unsupported_tp_size(tp_size, backend)

prompts = get_chicken_soup_prompts(4)

Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/test_spyre_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
pytest.param(2, marks=pytest.mark.multi),
pytest.param(4, marks=pytest.mark.multi),
pytest.param(8, marks=pytest.mark.multi),
])
],
ids=lambda val: f"TP({val})")
@pytest.mark.parametrize("backend", get_spyre_backend_list())
@pytest.mark.parametrize("warmup_shape", [[
(64, 20, 1),
Expand Down
11 changes: 6 additions & 5 deletions tests/e2e/test_spyre_prompt_logprobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
@pytest.mark.parametrize("backend", get_spyre_backend_list())
@pytest.mark.parametrize("model", get_spyre_model_list())
@pytest.mark.parametrize("tp_size", [
pytest.param(1, id="tp_size"),
pytest.param(2, marks=pytest.mark.multi, id="tp_size"),
pytest.param(4, marks=pytest.mark.multi, id="tp_size")
])
pytest.param(1),
pytest.param(2, marks=pytest.mark.multi),
pytest.param(4, marks=pytest.mark.multi)
],
ids=lambda val: f"TP({val})")
def test_prompt_logprobs(
backend: str,
model: str,
Expand All @@ -33,7 +34,7 @@ def test_prompt_logprobs(
This test checks the prompt_logprobs output from vllm against a reference
implementation using huggingface.
'''
skip_unsupported_tp_size(tp_size)
skip_unsupported_tp_size(tp_size, backend)
num_prompt_logprobs = 5

prompts = get_chicken_soup_prompts(4)
Expand Down
8 changes: 7 additions & 1 deletion tests/spyre_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,13 @@ def create_random_request(
**extra_kwargs)


def skip_unsupported_tp_size(size: int):
def skip_unsupported_tp_size(size: int, backend: str):
if backend in ["eager", "inductor"]:
# Spyre cards aren't required for running TP on CPU backends
# But it's really slow to run tp > 2
if size > 2:
pytest.skip("Skipping TP test on CPU with TP size > 2")
return
cards = int(os.getenv("AIU_WORLD_SIZE", "0"))
if cards < size:
pytest.skip(f"Cannot run TP size {size}: "
Expand Down
8 changes: 4 additions & 4 deletions vllm_spyre/v1/worker/spyre_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,6 @@ def execute_model(
masks=model_input.input_masks,
is_prompt=model_input.is_prompt)

# Only perform sampling in the driver worker.
if not self.is_driver_worker:
return EMPTY_MODEL_RUNNER_OUTPUT

# Compute the logits.
logits = self.model.compute_logits(hidden_states, None)

Expand Down Expand Up @@ -434,6 +430,10 @@ def execute_model(
prompt_logprobs_dicts = self._get_prompt_logprobs_dict(
logits=logits, model_inputs=model_input)

# Only return outputs from the driver worker
if not self.is_driver_worker:
return EMPTY_MODEL_RUNNER_OUTPUT

model_output = ModelRunnerOutput(
req_ids=list(req_id_to_index.keys()),
req_id_to_index=req_id_to_index,
Expand Down
Loading