Skip to content

Commit

Permalink
Simply test
Browse files Browse the repository at this point in the history
  • Loading branch information
yinggeh committed Aug 8, 2024
1 parent 3dd04c5 commit 07f2575
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions ci/L0_backend_vllm/metrics_test/vllm_metrics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,10 @@ def get_metrics(self):

return vllm_dict

def vllm_async_stream_infer(
def vllm_infer(
self,
prompts,
sampling_parameters,
stream,
send_parameters_as_tensor,
model_name,
):
"""
Expand All @@ -89,15 +87,15 @@ def vllm_async_stream_infer(
request_data = create_vllm_request(
prompts[i],
i,
stream,
False,
sampling_parameters,
model_name,
send_parameters_as_tensor,
True,
)
self.triton_client.async_stream_infer(
model_name=model_name,
request_id=request_data["request_id"],
inputs=request_data["inputs"],
request_id=request_data["request_id"],
outputs=request_data["outputs"],
parameters=sampling_parameters,
)
Expand All @@ -121,11 +119,9 @@ def test_vllm_metrics(self):
}

# Test vLLM metrics
self.vllm_async_stream_infer(
self.vllm_infer(
prompts=self.prompts,
sampling_parameters=self.sampling_parameters,
stream=False,
send_parameters_as_tensor=True,
model_name=self.vllm_model_name,
)
expected_metrics_dict["vllm:prompt_tokens_total"] = 18
Expand Down
2 changes: 1 addition & 1 deletion src/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def init_engine(self):
)

# Add vLLM custom metrics
if not self.metrics:
if self.metrics:
self.llm_engine.add_logger("triton", self.metrics)

def setup_lora(self):
Expand Down

0 comments on commit 07f2575

Please sign in to comment.