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 76d854c commit e9ad89f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:

- name: Upload benchmark images
uses: devicons/[email protected]
continue-on-error: true
continue-on-error: true # Important as it looks unstable: 503
id: imgur_step
with:
client_id: ${{secrets.IMGUR_CLIENT_ID}}
Expand Down Expand Up @@ -188,30 +188,30 @@ jobs:
<p align="center">
<img width="100%" height="100%" src="${{ fromJSON(steps.imgur_step.outputs.imgur_urls)[0] }}" alt="prompt_tokens_seconds" />
```mermaid
${{ env.PROMPT_TOKENS_SECONDS }}
```
```mermaid
${{ env.PROMPT_TOKENS_SECONDS }}
```
<img width="100%" height="100%" src="${{ fromJSON(steps.imgur_step.outputs.imgur_urls)[1] }}" alt="predicted_tokens_seconds"/>
```mermaid
${{ env.PREDICTED_TOKENS_SECONDS }}
```
```mermaid
${{ env.PREDICTED_TOKENS_SECONDS }}
```
</p>
<details>
<summary>Details</summary>
<p align="center">
<img width="100%" height="100%" src="${{ fromJSON(steps.imgur_step.outputs.imgur_urls)[2] }}" alt="kv_cache_usage_ratio" />
```mermaid
${{ env.KV_CACHE_USAGE_RATIO }}
```
```mermaid
${{ env.KV_CACHE_USAGE_RATIO }}
```
<img width="100%" height="100%" src="${{ fromJSON(steps.imgur_step.outputs.imgur_urls)[3] }}" alt="requests_processing"/>
```mermaid
${{ env.REQUESTS_PROCESSING }}
```
```mermaid
${{ env.REQUESTS_PROCESSING }}
```
</p>
</detail>
15 changes: 12 additions & 3 deletions examples/server/bench/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,19 @@ def main(args_in: list[str] | None = None) -> None:
# Mermaid format in case image failed
with (open(f"{metric}.mermaid", 'w') as mermaid_f):
mermaid = (
f"""xychart-beta
f"""---
config:
xyChart:
titleFontSize: 9
width: 900
height: 600
themeVariables:
xyChart:
titleColor: "#000000"
---
xychart-beta
title "{title}"
x-axis "{xlabel}" {int(min(timestamps))} --> {int(max(timestamps))}"
y-axis "{ylabel}"
x-axis "llamacpp:{metric}" {int(min(timestamps))} --> {int(max(timestamps))}
line [{', '.join([str(round(float(value))) for value in metric_values])}]
""")
mermaid_f.write(mermaid)
Expand Down

0 comments on commit e9ad89f

Please sign in to comment.