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
4 changes: 4 additions & 0 deletions benchmarking/src/llmperf/common_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
MEAN_INTER_TOKEN_LATENCY = 'client_mean_inter_token_latency_s' # Mean ITL per request
MEAN_OUTPUT_THROUGHPUT = 'mean_output_throughput_token_per_s' # Mean aggregate throughput

# Client network latency metrics (client-observed minus server-reported timings)
NETWORK_LATENCY_TTFT = 'client_network_latency_ttft_s' # client_ttft_s - server_ttft_s
NETWORK_LATENCY_E2E = 'client_network_latency_e2e_s' # client_end_to_end_latency_s - server_end_to_end_latency_s

# Server-side metrics
TTFT_SERVER = 'server_ttft_s'
E2E_LAT_SERVER = 'server_end_to_end_latency_s'
Expand Down
13 changes: 13 additions & 0 deletions benchmarking/src/llmperf/sambanova_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,19 @@ def _populate_client_metrics(

metrics[common_metrics.E2E_LAT] = total_request_time

# Client network latency: client-observed time minus server-reported time.
# Captures round-trip, request upload, SSE transport, and server queueing.
# Left as None when the server didn't report the corresponding timing.
ttft_server = metrics.get(common_metrics.TTFT_SERVER)
metrics[common_metrics.NETWORK_LATENCY_TTFT] = (
ttft - ttft_server if ttft_server is not None else None
)

e2e_lat_server = metrics.get(common_metrics.E2E_LAT_SERVER)
metrics[common_metrics.NETWORK_LATENCY_E2E] = (
total_request_time - e2e_lat_server if e2e_lat_server is not None else None
)

if number_chunks_received == 1:
metrics[common_metrics.REQ_OUTPUT_THROUGHPUT] = (
metrics[common_metrics.NUM_OUTPUT_TOKENS] / total_request_time
Expand Down
14 changes: 14 additions & 0 deletions benchmarking/src/performance_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,19 @@ def build_metrics_summary(
common_metrics.NUM_INPUT_TOKENS,
common_metrics.NUM_OUTPUT_TOKENS,
common_metrics.MEAN_INTER_TOKEN_LATENCY,
common_metrics.NETWORK_LATENCY_TTFT,
common_metrics.NETWORK_LATENCY_E2E,
]:
if self.show_results_in_terminal:
logger.info(f'Building Client Metrics Summary for metric: {metric}')
metrics_summary[metric] = {}

# Skip metric if column is absent (for backward compatibility with old result files)
if metric not in metrics_df.columns:
if self.show_results_in_terminal:
logger.info(f' Column {metric} not present, skipping')
continue

# Get flattened list from metric column in metrics df
series = pd.Series(list(flatten(metrics_df[metric]))).dropna()

Expand Down Expand Up @@ -299,6 +307,12 @@ def build_metrics_summary(
logger.info(f'Building Server Metrics Summary for metric: {metric}')
metrics_summary[metric] = {}

# Skip metric if column is absent (for backward compatibility with old result files)
if metric not in metrics_df.columns:
if self.show_results_in_terminal:
logger.info(f' Column {metric} not present, skipping')
continue

# Get flattened list from metric column in metrics df
series = pd.Series(list(flatten(metrics_df[metric]))).dropna()

Expand Down
Loading