Skip to content

Commit

Permalink
Fix some testing
Browse files Browse the repository at this point in the history
  • Loading branch information
debermudez committed Mar 9, 2024
1 parent b5d579f commit f90fb06
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/c++/perf_analyzer/genai-pa/genai_pa/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def _add_profile_args(parser):
"For example, if the profile export file is profile_export.json, the GenAi-PA file will be "
"exported to profile_export_genai_pa.csv.",
)

load_management_group.add_argument(
"--request-rate",
type=float,
Expand All @@ -185,7 +186,7 @@ def _add_profile_args(parser):
help="Indicates the allowed variation in "
"latency measurements when determining if a result is stable. The "
"measurement is considered as stable if the ratio of max / min "
"from the recent 3 measurements is within (stability percentage)% "
"from the recent 3 measurements is within (stability percentage) "
"in terms of both infer per second and latency.",
)

Expand Down
3 changes: 0 additions & 3 deletions src/c++/perf_analyzer/genai-pa/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,12 @@ def test_help_arguments_output_and_exit(self, arg, expected_output, capsys):
[
(["-b", "2"], {"batch_size": 2}),
(["--batch-size", "2"], {"batch_size": 2}),
(["--max-threads", "4"], {"max_threads": 4}),
(
["--profile-export-file", "text.txt"],
{"profile_export_file": Path("text.txt")},
),
(["--service-kind", "triton"], {"service_kind": "triton"}),
(["--service-kind", "openai"], {"service_kind": "openai"}),
# TODO: Remove streaming from implementation. It is invalid with HTTP.
# (["--streaming"], {"streaming": True}),
(["--version"], {"version": True}),
(["-u", "test_url"], {"u": "test_url"}),
(["--url", "test_url"], {"u": "test_url"}),
Expand Down
10 changes: 5 additions & 5 deletions src/c++/perf_analyzer/genai-pa/tests/test_llm_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def test_triton_llm_profile_data(self, prepare_triton_profile_data) -> None:
)

# experiment 1 statistics
stat = pd.get_statistics(infer_mode="concurrency", load_level=10)
stat = pd.get_statistics(infer_mode="concurrency", load_level="10")

assert stat.avg_time_to_first_token == 2
assert stat.avg_inter_token_latency == 2.25
Expand Down Expand Up @@ -227,7 +227,7 @@ def test_triton_llm_profile_data(self, prepare_triton_profile_data) -> None:
assert stat.std_num_output_token == np.std([3, 5])

# experiment 2 statistics
stat = pd.get_statistics(infer_mode="request_rate", load_level=2.0)
stat = pd.get_statistics(infer_mode="request_rate", load_level="2.0")

assert stat.avg_time_to_first_token == 2.5
assert stat.avg_inter_token_latency == 3
Expand Down Expand Up @@ -256,7 +256,7 @@ def test_triton_llm_profile_data(self, prepare_triton_profile_data) -> None:

# check non-existing profile data
with pytest.raises(KeyError):
pd.get_statistics(infer_mode="concurrency", load_level=30)
pd.get_statistics(infer_mode="concurrency", load_level="30")

def test_openai_llm_profile_data(self, prepare_openai_profile_data) -> None:
"""Collect LLM metrics from profile export data and check values.
Expand All @@ -280,7 +280,7 @@ def test_openai_llm_profile_data(self, prepare_openai_profile_data) -> None:
)

# experiment 1 statistics
stat = pd.get_statistics(infer_mode="concurrency", load_level=10)
stat = pd.get_statistics(infer_mode="concurrency", load_level="10")

assert stat.avg_time_to_first_token == 2
assert stat.avg_inter_token_latency == 2.4
Expand Down Expand Up @@ -309,7 +309,7 @@ def test_openai_llm_profile_data(self, prepare_openai_profile_data) -> None:

# check non-existing profile data
with pytest.raises(KeyError):
pd.get_statistics(infer_mode="concurrency", load_level=40)
pd.get_statistics(infer_mode="concurrency", load_level="40")

def test_llm_metrics_get_base_name(self) -> None:
"""Test get_base_name method in LLMMetrics class."""
Expand Down

0 comments on commit f90fb06

Please sign in to comment.