Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(shortfin-sd) Cleanup args and instructions. #511

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
14 changes: 13 additions & 1 deletion shortfin/python/shortfin_apps/sd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ pip install pillow
pip install shark-ai

```

Temporarily, you may need an update to your `shortfin` install.
Choose the latest pre-release from https://github.com/nod-ai/SHARK-Platform/releases/tag/dev-wheels, and install with:
```
pip uninstall shortfin -y
pip install https://<pre-release>.whl
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work:

pip install shortfin -f https://github.com/nod-ai/SHARK-Platform/releases/expanded_assets/dev-wheels

If you pass --upgrade --pre, I think it should upgrade in place

developer docs: https://github.com/nod-ai/SHARK-Platform/blob/main/docs/nightly_releases.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works like a charm. Thanks.


```
python -m shortfin_apps.sd.server --help
```
Expand All @@ -27,7 +35,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
Expand Down
6 changes: 0 additions & 6 deletions shortfin/python/shortfin_apps/sd/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
4 changes: 3 additions & 1 deletion shortfin/python/shortfin_apps/sd/simple_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down
Loading