[CI] Revive 8-GPU trace upload in nightly test workflow (#18820)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kangyan-Zhou
2026-02-14 08:37:08 +08:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 1be41e9036
commit eccf875d49
2 changed files with 70 additions and 17 deletions
+38
View File
@@ -120,6 +120,25 @@ jobs:
cd test cd test
python3 run_suite.py --hw cuda --suite nightly-8-gpu-common --nightly --timeout-per-file=18000 --continue-on-error --auto-partition-id=${{ matrix.partition }} --auto-partition-size=4 python3 run_suite.py --hw cuda --suite nightly-8-gpu-common --nightly --timeout-per-file=18000 --continue-on-error --auto-partition-id=${{ matrix.partition }} --auto-partition-size=4
- name: Publish traces to storage repo
if: always()
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_FOR_NIGHTLY_CI_DATA }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_NUMBER: ${{ github.run_number }}
run: |
TRACE_ARGS=""
for dir in test/performance_profiles_*/; do
[ -d "$dir" ] && TRACE_ARGS="$TRACE_ARGS --traces-dir $dir"
done
if [ -n "$TRACE_ARGS" ]; then
python3 scripts/ci/utils/publish_traces.py $TRACE_ARGS
find test/performance_profiles_*/ -name '*.json.gz' -delete
else
echo "No trace directories found, skipping publish"
fi
- name: Run test - name: Run test
timeout-minutes: 30 timeout-minutes: 30
env: env:
@@ -201,6 +220,25 @@ jobs:
cd test cd test
IS_BLACKWELL=1 python3 run_suite.py --hw cuda --suite nightly-8-gpu-common --nightly --timeout-per-file=12000 --continue-on-error --auto-partition-id=${{ matrix.partition }} --auto-partition-size=4 IS_BLACKWELL=1 python3 run_suite.py --hw cuda --suite nightly-8-gpu-common --nightly --timeout-per-file=12000 --continue-on-error --auto-partition-id=${{ matrix.partition }} --auto-partition-size=4
- name: Publish traces to storage repo
if: always()
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_FOR_NIGHTLY_CI_DATA }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_NUMBER: ${{ github.run_number }}
run: |
TRACE_ARGS=""
for dir in test/performance_profiles_*/; do
[ -d "$dir" ] && TRACE_ARGS="$TRACE_ARGS --traces-dir $dir"
done
if [ -n "$TRACE_ARGS" ]; then
python3 scripts/ci/utils/publish_traces.py $TRACE_ARGS
find test/performance_profiles_*/ -name '*.json.gz' -delete
else
echo "No trace directories found, skipping publish"
fi
- name: Collect performance metrics - name: Collect performance metrics
if: always() if: always()
run: | run: |
+32 -17
View File
@@ -331,7 +331,20 @@ def copy_trace_files(source_dir, target_base_path):
def publish_traces(traces_dir, run_id, run_number): def publish_traces(traces_dir, run_id, run_number):
"""Publish traces to GitHub repository in a single commit""" """Publish traces from a single directory to GitHub repository in a single commit"""
target_base_path = f"traces/{run_id}"
files_to_upload = copy_trace_files(traces_dir, target_base_path)
if not files_to_upload:
print("No trace files found to upload")
return
print(f"Found {len(files_to_upload)} files to upload")
publish_traces_from_files(files_to_upload, run_id, run_number)
def publish_traces_from_files(files_to_upload, run_id, run_number):
"""Publish pre-collected trace files to GitHub repository in a single commit"""
# Get environment variables # Get environment variables
token = os.getenv("GITHUB_TOKEN") token = os.getenv("GITHUB_TOKEN")
if not token: if not token:
@@ -342,16 +355,6 @@ def publish_traces(traces_dir, run_id, run_number):
repo_owner = "sglang-bot" repo_owner = "sglang-bot"
repo_name = "sglang-ci-data" repo_name = "sglang-ci-data"
branch = "main" branch = "main"
target_base_path = f"traces/{run_id}"
# Copy trace files
files_to_upload = copy_trace_files(traces_dir, target_base_path)
if not files_to_upload:
print("No trace files found to upload")
return
print(f"Found {len(files_to_upload)} files to upload")
# Verify token permissions before proceeding # Verify token permissions before proceeding
permission_check = verify_token_permissions(repo_owner, repo_name, token) permission_check = verify_token_permissions(repo_owner, repo_name, token)
@@ -475,8 +478,10 @@ def main():
parser.add_argument( parser.add_argument(
"--traces-dir", "--traces-dir",
type=str, type=str,
action="append",
dest="traces_dirs",
required=True, required=True,
help="Traces directory to publish", help="Traces directory to publish (can be specified multiple times)",
) )
args = parser.parse_args() args = parser.parse_args()
@@ -490,12 +495,22 @@ def main():
) )
sys.exit(1) sys.exit(1)
# Use traces directory # Collect trace files from all directories
traces_dir = args.traces_dir target_base_path = f"traces/{run_id}"
print(f"Processing traces from directory: {traces_dir}") all_files = []
for traces_dir in args.traces_dirs:
print(f"Processing traces from directory: {traces_dir}")
files = copy_trace_files(traces_dir, target_base_path)
all_files.extend(files)
# Publish traces if not all_files:
publish_traces(traces_dir, run_id, run_number) print("No trace files found to upload across all directories")
return
print(f"Found {len(all_files)} total files to upload")
# Publish all collected traces in a single commit
publish_traces_from_files(all_files, run_id, run_number)
if __name__ == "__main__": if __name__ == "__main__":