diff --git a/.github/workflows/collect-results.yml b/.github/workflows/collect-results.yml index 64e6ef3e1..08892d166 100644 --- a/.github/workflows/collect-results.yml +++ b/.github/workflows/collect-results.yml @@ -41,6 +41,7 @@ jobs: run: | pip install -q matplotlib python3 utils/plot_perf.py results/ ${{ inputs.exp-name || 'all' }} + - name: Upload performance graphs uses: actions/upload-artifact@v5 with: @@ -48,3 +49,12 @@ jobs: path: | tput_vs_intvty_*_${{ inputs.exp-name || 'all' }}.png tput_vs_e2el_*_${{ inputs.exp-name || 'all' }}.png + + - name: Display graphs in summary + run: | + python3 utils/display_graphs.py \ + ${{ inputs.exp-name || 'all' }} \ + ${{ github.repository }} \ + ${{ github.run_id }} \ + graphs_${{ inputs.exp-name || 'all' }} \ + >> $GITHUB_STEP_SUMMARY diff --git a/utils/display_graphs.py b/utils/display_graphs.py new file mode 100644 index 000000000..2659e58a6 --- /dev/null +++ b/utils/display_graphs.py @@ -0,0 +1,50 @@ +import sys +from pathlib import Path + + +def display_graphs(exp_name, repo, run_id, artifact_name): + """Display performance graphs in GitHub Actions summary with artifact links.""" + print("\n## Performance Graphs\n") + + # Find all generated graphs + current_dir = Path('.') + + # Look for tput_vs_intvty graphs + intvty_graphs = sorted(current_dir.glob(f'tput_vs_intvty_*_{exp_name}.png')) + e2el_graphs = sorted(current_dir.glob(f'tput_vs_e2el_*_{exp_name}.png')) + + # Construct artifact download URL + artifact_url = f"https://github.com/{repo}/actions/runs/{run_id}/artifacts" + + # Display interactivity graphs + if intvty_graphs: + print("### Throughput vs Interactivity\n") + for graph in intvty_graphs: + # Extract model name from filename + model_name = graph.name.replace(f'tput_vs_intvty_', '').replace(f'_{exp_name}.png', '') + print(f"#### {model_name.upper()}\n") + print(f"📊 [{graph.name}]({artifact_url}) (download `{artifact_name}` artifact)\n") + + # Display end-to-end latency graphs + if e2el_graphs: + print("### Throughput vs End-to-End Latency\n") + for graph in e2el_graphs: + # Extract model name from filename + model_name = graph.name.replace(f'tput_vs_e2el_', '').replace(f'_{exp_name}.png', '') + print(f"#### {model_name.upper()}\n") + print(f"📊 [{graph.name}]({artifact_url}) (download `{artifact_name}` artifact)\n") + + if not intvty_graphs and not e2el_graphs: + print("*No performance graphs were generated.*\n") + + +if __name__ == '__main__': + if len(sys.argv) < 5: + print("Usage: python3 display_graphs.py ") + sys.exit(1) + + exp_name = sys.argv[1] + repo = sys.argv[2] + run_id = sys.argv[3] + artifact_name = sys.argv[4] + display_graphs(exp_name, repo, run_id, artifact_name)