Skip to content

Commit

Permalink
Added very basic unit testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nv-braf committed Nov 5, 2024
1 parent f6176c7 commit e1049ce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions genai-perf/tests/test_llm_profile_data_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from genai_perf.metrics import LLMMetrics
from genai_perf.metrics.statistics import Statistics
from genai_perf.profile_data_parser import LLMProfileDataParser
from genai_perf.record.types.request_throughput_avg import RequestThroughputAvg
from genai_perf.tokenizer import DEFAULT_TOKENIZER, get_tokenizer

from .test_utils import check_statistics, ns_to_sec
Expand Down Expand Up @@ -216,6 +217,11 @@ def test_triton_llm_profile_data(
check_llm_metrics(metrics, expected_metrics)
check_statistics(statistics, expected_statistics)

# Check that Records can be created
records = statistics.create_records()
assert records is not None
assert records[0].tag == RequestThroughputAvg.tag

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

0 comments on commit e1049ce

Please sign in to comment.