|
71 | 71 | timeout-minutes: 30 |
72 | 72 | shell: bash |
73 | 73 | run: | |
74 | | - output=$(bash run.sh) |
75 | | - echo "$output" |
76 | | -
|
77 | | - # Extract metrics using Python and regex |
78 | | - python - << EOF |
79 | | - import re |
80 | | - import json |
81 | | - |
82 | | - text = \"\"\"${output}\"\"\" |
83 | | - |
84 | | - ttft_pattern = r"TTFT: ([\d.]+) ms ± ([\d.]+)%" |
85 | | - e2e_latency_pattern = r"E2E Latency: ([\d.]+) ms ± ([\d.]+)%" |
86 | | - tpot_pattern = r"TPOT: ([\d.]+) ms" |
87 | | - |
88 | | - ttft_match = re.search(ttft_pattern, text) |
89 | | - e2e_latency_match = re.search(e2e_latency_pattern, text) |
90 | | - tpot_match = re.search(tpot_pattern, text) |
91 | | - |
92 | | - metrics = { |
93 | | - "TTFT": {"value": ttft_match.group(1) if ttft_match else None, "std_dev": ttft_match.group(2) if ttft_match else None}, |
94 | | - "E2E Latency": {"value": e2e_latency_match.group(1) if e2e_latency_match else None, "std_dev": e2e_latency_match.group(2) if e2e_latency_match else None}, |
95 | | - "TPOT": {"value": tpot_match.group(1) if tpot_match else None}, |
96 | | - } |
97 | | - |
98 | | - with open("metrics.json", "w") as f: |
99 | | - json.dump(metrics, f, indent=4) |
100 | | - |
101 | | - print(f"::set-output name=metrics::{json.dumps(metrics)}") |
102 | | - EOF |
103 | | -
|
104 | | - # Upload metrics as an artifact (optional) |
105 | | - # Create the results directory if it doesn't exist |
106 | | - mkdir -p ../../../../../results |
107 | | - |
108 | | - # Copy the metrics.json file to the results directory |
109 | | - cp metrics.json ../../../../../results/ |
| 74 | + bash run.sh > results/flax_2b.log 2>&1 |
110 | 75 |
|
111 | 76 | - name: Wait For Connection |
112 | 77 | uses: google-ml-infra/actions/ci_connection@main |
|
0 commit comments