Skip to content

Commit 6d674e9

Browse files
committed
allowing test runs
1 parent fb6d3b3 commit 6d674e9

3 files changed

Lines changed: 22 additions & 13 deletions

File tree

.editorconfig

Whitespace-only changes.

.github/workflows/run-sweep.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
name: "Run Sweep"
2+
run-name: Run Sweep - ${{ github.event.pull_request.title || github.ref_name }}
23

34
on:
45
workflow_dispatch:
56
push:
67
branches:
78
- main
8-
- diff-only-runs
9-
# paths:
10-
# - "perf-changelog.yaml"
9+
paths:
10+
- "perf-changelog.yaml"
11+
pull_request:
12+
branches:
13+
- main
14+
types:
15+
- ready_for_review
16+
- synchronize
17+
paths:
18+
- "perf-changelog.yaml"
1119

1220
jobs:
1321
get-jobs:
@@ -22,11 +30,18 @@ jobs:
2230

2331
- id: get-jobs
2432
run: |
25-
pip install pydantic
33+
if [ "${{ github.event_name }}" == "pull_request" ]; then
34+
BASE_REF="origin/${{ github.base_ref }}"
35+
HEAD_REF="${{ github.event.pull_request.head.sha }}"
36+
else
37+
BASE_REF="${{ github.event.before }}"
38+
HEAD_REF="${{ github.event.after }}"
39+
fi
40+
2641
CONFIG_JSON=$(python3 ${GITHUB_WORKSPACE}/utils/process_changelog.py \
2742
--changelog-file ${GITHUB_WORKSPACE}/perf-changelog.yaml \
28-
--base-ref origin/main \
29-
--head-ref ${{ github.sha }})
43+
--base-ref "$BASE_REF" \
44+
--head-ref "$HEAD_REF")
3045
3146
echo "search-space-config=$CONFIG_JSON" >> $GITHUB_OUTPUT
3247

utils/process_changelog.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
import argparse
22
import json
3-
from pprint import pprint
43
import re
54
import subprocess
65
from collections import defaultdict
76

87
import yaml
98
from constants import GENERATE_SWEEPS_PY_SCRIPT, MASTER_CONFIGS, RUNNER_CONFIG
10-
from matrix_logic.generate_sweep_configs import (
11-
seq_len_itos,
12-
seq_len_stoi,
13-
seq_len_to_str,
14-
)
9+
from matrix_logic.generate_sweep_configs import seq_len_to_str
1510
from matrix_logic.validation import load_config_files
1611
from pydantic import BaseModel, ConfigDict, Field
1712

@@ -132,7 +127,6 @@ def main():
132127
else:
133128
final_results["single_node"][seq_len_str].append(result)
134129

135-
# pprint(final_results)
136130
print(json.dumps(final_results))
137131

138132

0 commit comments

Comments
 (0)