From b9a87d05d1e85f5b0d61485dc2abe9bf6b24d9af Mon Sep 17 00:00:00 2001 From: Ean Garvey Date: Thu, 14 Nov 2024 16:19:51 +0000 Subject: [PATCH] Removing unused args and misleading measurements. --- shortfin/python/shortfin_apps/sd/README.md | 6 +++++- shortfin/python/shortfin_apps/sd/server.py | 6 ------ shortfin/python/shortfin_apps/sd/simple_client.py | 4 +++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/shortfin/python/shortfin_apps/sd/README.md b/shortfin/python/shortfin_apps/sd/README.md index 30002ec40..15a330cd4 100644 --- a/shortfin/python/shortfin_apps/sd/README.md +++ b/shortfin/python/shortfin_apps/sd/README.md @@ -27,7 +27,11 @@ You can check if this (or any) port is in use on Linux with `ss -ntl | grep 8000 ``` python -m shortfin_apps.sd.server --device=amdgpu --device_ids=0 --build_preference=precompiled --topology="spx_single" ``` - + - Wait until your server outputs: +``` +INFO - Application startup complete. +INFO - Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) +``` - Run a CLI client in a separate shell: ``` python -m shortfin_apps.sd.simple_client --interactive diff --git a/shortfin/python/shortfin_apps/sd/server.py b/shortfin/python/shortfin_apps/sd/server.py index 2b7a93a91..9cd624241 100644 --- a/shortfin/python/shortfin_apps/sd/server.py +++ b/shortfin/python/shortfin_apps/sd/server.py @@ -242,12 +242,6 @@ def main(argv, log_config=uvicorn.config.LOGGING_CONFIG): parser = argparse.ArgumentParser() parser.add_argument("--host", type=str, default=None) parser.add_argument("--port", type=int, default=8000) - parser.add_argument( - "--root-path", - type=str, - default=None, - help="Root path to use for installing behind path based proxy.", - ) parser.add_argument( "--timeout-keep-alive", type=int, default=5, help="Keep alive timeout" ) diff --git a/shortfin/python/shortfin_apps/sd/simple_client.py b/shortfin/python/shortfin_apps/sd/simple_client.py index 550fd7c60..bc0f10655 100644 --- a/shortfin/python/shortfin_apps/sd/simple_client.py +++ b/shortfin/python/shortfin_apps/sd/simple_client.py @@ -119,7 +119,9 @@ async def static(args): if not any([i is None for i in [latencies, sample_counts]]): total_num_samples = sum(sample_counts) sps = str(total_num_samples / (end - start)) - print(f"Average throughput: {sps} samples per second") + # Until we have better measurements, don't report the throughput that includes saving images. + if not args.save: + print(f"Average throughput: {sps} samples per second") else: raise ValueError("Received error response from server.")