Skip to content

Commit 87b8285

Browse files
authored
Merge branch 'main' into export-D87519599
2 parents c9136eb + 268e885 commit 87b8285

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2618
-1152
lines changed

.ci/scripts/cuda_benchmark.py

Lines changed: 939 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
# Quick script to trigger cuda-perf workflow via GitHub CLI
9+
# Usage:
10+
# ./trigger_cuda_perf.sh # Use defaults (random model + quant)
11+
# ./trigger_cuda_perf.sh --all # Run ALL models with ALL quantizations
12+
# ./trigger_cuda_perf.sh "openai/whisper-medium" # Single model
13+
# ./trigger_cuda_perf.sh "openai/whisper-small,google/gemma-3-4b-it" "non-quantized,quantized-int4-tile-packed" "100"
14+
15+
set -e
16+
17+
# All available models and quantizations
18+
ALL_MODELS="mistralai/Voxtral-Mini-3B-2507,openai/whisper-small,openai/whisper-medium,openai/whisper-large-v3-turbo,google/gemma-3-4b-it"
19+
ALL_QUANTIZATIONS="non-quantized,quantized-int4-tile-packed,quantized-int4-weight-only"
20+
21+
# Check if gh CLI is installed
22+
if ! command -v gh &> /dev/null; then
23+
echo "Error: GitHub CLI (gh) is not installed."
24+
echo "Install it from: https://cli.github.com/"
25+
echo ""
26+
echo "Quick install:"
27+
echo " macOS: brew install gh"
28+
echo " Linux: See https://github.com/cli/cli/blob/trunk/docs/install_linux.md"
29+
exit 1
30+
fi
31+
32+
# Check for --all flag
33+
RUN_ALL=false
34+
if [ "${1:-}" = "--all" ] || [ "${1:-}" = "-a" ]; then
35+
RUN_ALL=true
36+
shift # Remove the flag from arguments
37+
fi
38+
39+
# Default parameters
40+
if [ "$RUN_ALL" = true ]; then
41+
MODELS="$ALL_MODELS"
42+
QUANT="$ALL_QUANTIZATIONS"
43+
NUM_RUNS="${1:-50}"
44+
RANDOM_MODEL="false"
45+
echo "========================================="
46+
echo "Triggering cuda-perf workflow"
47+
echo "Mode: RUN ALL MODELS AND QUANTIZATIONS"
48+
echo "========================================="
49+
echo "Models: ALL (5 models)"
50+
echo "Quantizations: ALL (3 quantizations)"
51+
echo "Total configs: 15 combinations"
52+
echo "Num runs: $NUM_RUNS"
53+
echo "========================================="
54+
else
55+
MODELS="${1:-}"
56+
QUANT="${2:-}"
57+
NUM_RUNS="${3:-50}"
58+
RANDOM_MODEL="${4:-false}"
59+
60+
# Display configuration
61+
echo "========================================="
62+
echo "Triggering cuda-perf workflow"
63+
echo "========================================="
64+
if [ -z "$MODELS" ]; then
65+
echo "Models: (random selection)"
66+
else
67+
echo "Models: $MODELS"
68+
fi
69+
if [ -z "$QUANT" ]; then
70+
echo "Quantizations: (random selection)"
71+
else
72+
echo "Quantizations: $QUANT"
73+
fi
74+
echo "Num runs: $NUM_RUNS"
75+
echo "Random model: $RANDOM_MODEL"
76+
echo "========================================="
77+
fi
78+
79+
echo ""
80+
81+
# Trigger workflow
82+
gh workflow run cuda-perf.yml \
83+
-R pytorch/executorch \
84+
-f models="$MODELS" \
85+
-f quantizations="$QUANT" \
86+
-f num_runs="$NUM_RUNS" \
87+
-f random_model="$RANDOM_MODEL"
88+
89+
if [ $? -eq 0 ]; then
90+
echo "✓ Workflow triggered successfully!"
91+
echo ""
92+
echo "View status:"
93+
echo " gh run list --workflow=cuda-perf.yml"
94+
echo ""
95+
echo "Watch the latest run:"
96+
echo " gh run watch \$(gh run list --workflow=cuda-perf.yml --limit 1 --json databaseId --jq '.[0].databaseId')"
97+
else
98+
echo "✗ Failed to trigger workflow"
99+
exit 1
100+
fi

0 commit comments

Comments
 (0)