Skip to content

Commit

Permalink
ci: test mermaid
Browse files Browse the repository at this point in the history
  • Loading branch information
phymbert committed Mar 25, 2024
1 parent 12211ab commit e8c4568
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
--branch ${{ github.head_ref || github.ref_name }} \
--commit ${{ github.sha }} \
--scenario script.js \
--duration 2m \
--duration 1m \
--hf-repo ggml-org/models \
--hf-file phi-2/ggml-model-q4_0.gguf \
--model-path-prefix /models \
Expand All @@ -122,6 +122,21 @@ jobs:
echo KV_CACHE_USAGE_RATIO_=${KV_CACHE_USAGE_RATIO//<br>/\n} >> $GITHUB_ENV
echo REQUESTS_PROCESSING_=${REQUESTS_PROCESSING//<br>/\n} >> $GITHUB_ENV
- name: Server bench
id: server_bench_mermaid
env:
PROMPT_TOKENS_SECONDS: ${{ env.PROMPT_TOKENS_SECONDS }}
PREDICTED_TOKENS_SECONDS: ${{ env.PREDICTED_TOKENS_SECONDS }}
KV_CACHE_USAGE_RATIO: ${{ env.KV_CACHE_USAGE_RATIO }}
REQUESTS_PROCESSING: ${{ env.REQUESTS_PROCESSING }}
run: |
set -eux
echo PROMPT_TOKENS_SECONDS_=${PROMPT_TOKENS_SECONDS//<br>/\n} >> $GITHUB_ENV
echo PREDICTED_TOKENS_SECONDS_=${PREDICTED_TOKENS_SECONDS//<br>/\n} >> $GITHUB_ENV
echo KV_CACHE_USAGE_RATIO_=${KV_CACHE_USAGE_RATIO//<br>/\n} >> $GITHUB_ENV
echo REQUESTS_PROCESSING_=${REQUESTS_PROCESSING//<br>/\n} >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
name: benchmark-results
Expand Down
4 changes: 2 additions & 2 deletions examples/server/bench/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def main(args_in: list[str] | None = None) -> None:
plt.ylabel(ylabel, fontsize=22)
plt.xlabel(xlabel, fontsize=14, wrap=True)
plt.gca().xaxis.set_major_locator(matplotlib.dates.MinuteLocator())
plt.gca().xaxis.set_major_formatter(matplotlib.dates.DateFormatter("%Y%m%d %H:%M:%S"))
plt.gca().xaxis.set_major_formatter(matplotlib.dates.DateFormatter("%Y-%m-%d %H:%M:%S"))
plt.gcf().autofmt_xdate()

# Remove borders
Expand All @@ -157,7 +157,7 @@ def main(args_in: list[str] | None = None) -> None:
mermaid = f"""```mermaid
xychart-beta
title "{title}"
x-axis "{xlabel}" ["{'", "'.join([datetime.fromtimestamp(int(ts)).strftime("%Y%m%d %H:%M:%S") for ts in timestamps])}"]
x-axis "{xlabel}" ["{'", "'.join([datetime.fromtimestamp(int(ts)).strftime("%Y-%m-%d %H:%M:%S") for ts in timestamps])}"]
y-axis "{ylabel}"
line [{', '.join([str(round(float(value))) for value in metric_values])}]
```
Expand Down

0 comments on commit e8c4568

Please sign in to comment.