Skip to content

Commit c71ed77

Browse files
committed
Merge remote-tracking branch 'remotes/upstream/master' into PCSG
2 parents a0d0d2a + 76d6a5c commit c71ed77

File tree

123 files changed

+9499
-5213
lines changed

Some content is hidden

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

123 files changed

+9499
-5213
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Feature request
3+
about: Propose an enhancement to MFC
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
### Problem it solves
10+
<!-- What limitation or use case does this address? -->
11+
12+
### Proposed solution
13+
<!-- Describe the change and where it integrates (modules, scripts, docs). -->
14+
15+
### Alternatives
16+
<!-- Any other approaches considered -->
17+
18+
### Additional context
19+
<!-- Links, references, mockups, examples -->
20+
21+
22+
23+
24+
25+
26+

.github/workflows/bench.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,40 @@ jobs:
3636
labels: gt
3737
flag: p
3838
device: cpu
39+
interface: none
3940
build_script: ""
4041
- cluster: phoenix
4142
name: Georgia Tech | Phoenix (NVHPC)
4243
group: phoenix
4344
labels: gt
4445
flag: p
4546
device: gpu
47+
interface: acc
4648
build_script: ""
49+
- cluster: phoenix
50+
name: Georgia Tech | Phoenix (NVHPC)
51+
group: phoenix
52+
labels: gt
53+
flag: p
54+
device: gpu
55+
interface: omp
56+
build_script: ""
57+
- cluster: frontier
58+
name: Oak Ridge | Frontier (CCE)
59+
group: phoenix
60+
labels: frontier
61+
flag: f
62+
device: gpu
63+
interface: acc
64+
build_script: "bash .github/workflows/frontier/build.sh gpu acc bench"
4765
- cluster: frontier
4866
name: Oak Ridge | Frontier (CCE)
4967
group: phoenix
5068
labels: frontier
5169
flag: f
5270
device: gpu
53-
build_script: "bash .github/workflows/frontier/build.sh gpu bench"
71+
interface: omp
72+
build_script: "bash .github/workflows/frontier/build.sh gpu omp bench"
5473
runs-on:
5574
group: ${{ matrix.group }}
5675
labels: ${{ matrix.labels }}
@@ -80,29 +99,29 @@ jobs:
8099
81100
- name: Bench (Master v. PR)
82101
run: |
83-
(cd pr && bash .github/workflows/${{ matrix.cluster }}/submit-bench.sh .github/workflows/${{ matrix.cluster }}/bench.sh ${{ matrix.device }}) &
84-
(cd master && bash .github/workflows/${{ matrix.cluster }}/submit-bench.sh .github/workflows/${{ matrix.cluster }}/bench.sh ${{ matrix.device }}) &
102+
(cd pr && bash .github/workflows/${{ matrix.cluster }}/submit-bench.sh .github/workflows/${{ matrix.cluster }}/bench.sh ${{ matrix.device }} ${{ matrix.interface }}) &
103+
(cd master && bash .github/workflows/${{ matrix.cluster }}/submit-bench.sh .github/workflows/${{ matrix.cluster }}/bench.sh ${{ matrix.device }} ${{ matrix.interface }}) &
85104
wait %1 && wait %2
86105
87106
- name: Generate & Post Comment
88107
run: |
89108
(cd pr && . ./mfc.sh load -c ${{ matrix.flag }} -m g)
90-
(cd pr && ./mfc.sh bench_diff ../master/bench-${{ matrix.device }}.yaml ../pr/bench-${{ matrix.device }}.yaml)
109+
(cd pr && ./mfc.sh bench_diff ../master/bench-${{ matrix.device }}-${{ matrix.interface }}.yaml ../pr/bench-${{ matrix.device }}-${{ matrix.interface }}.yaml)
91110
92111
- name: Print Logs
93112
if: always()
94113
run: |
95-
cat pr/bench-${{ matrix.device }}.* 2>/dev/null || true
96-
cat master/bench-${{ matrix.device }}.* 2>/dev/null || true
114+
cat pr/bench-${{ matrix.device }}-${{ matrix.interface }}.* 2>/dev/null || true
115+
cat master/bench-${{ matrix.device }}-${{ matrix.interface }}.* 2>/dev/null || true
97116
98117
# All other runners (non-Phoenix) just run without special env
99118
- name: Archive Logs (Frontier)
100119
if: always() && matrix.cluster != 'phoenix'
101120
uses: actions/upload-artifact@v4
102121
with:
103-
name: ${{ matrix.cluster }}-${{ matrix.device }}
122+
name: ${{ matrix.cluster }}-${{ matrix.device }}-${{ matrix.interface }}
104123
path: |
105-
pr/bench-${{ matrix.device }}.*
124+
pr/bench-${{ matrix.device }}-${{ matrix.interface }}.*
106125
pr/build/benchmarks/*
107-
master/bench-${{ matrix.device }}.*
126+
master/bench-${{ matrix.device }}-${{ matrix.interface }}.*
108127
master/build/benchmarks/*

.github/workflows/deploy-tap.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Deploy Homebrew Tap
2+
3+
on:
4+
# Test formula on PRs (audit only, don't deploy)
5+
pull_request:
6+
branches: [ master ]
7+
paths:
8+
- 'packaging/homebrew/mfc.rb'
9+
- 'packaging/homebrew/README.md'
10+
# Deploy to tap on push to master
11+
push:
12+
branches: [ master, homebrew-new ]
13+
paths:
14+
- 'packaging/homebrew/mfc.rb'
15+
- 'packaging/homebrew/README.md'
16+
tags:
17+
- 'v*.*.*'
18+
# Allow manual trigger for testing
19+
workflow_dispatch:
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
deploy-tap:
26+
name: Audit and deploy formula
27+
runs-on: macos-14
28+
permissions:
29+
contents: write
30+
pull-requests: write
31+
steps:
32+
- name: Checkout MFC repository
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
36+
37+
- name: Determine event metadata
38+
id: meta
39+
run: |
40+
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
41+
VERSION="${GITHUB_REF_NAME#v}"
42+
URL="https://github.com/${{ github.repository }}/archive/refs/tags/v${VERSION}.tar.gz"
43+
else
44+
# Extract URL from current formula to re-audit and sync
45+
URL="$(grep -Eo 'https://github.com/.*/archive/refs/tags/v[0-9]+\.[0-9]+\.[0-9]+\.tar\.gz' packaging/homebrew/mfc.rb | head -n1)"
46+
VERSION="$(echo "${URL}" | sed -E 's/.*v([0-9]+\.[0-9]+\.[0-9]+)\.tar\.gz/\1/')"
47+
fi
48+
SHASUM="$(curl -sL "${URL}" | shasum -a 256 | awk '{print $1}')"
49+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
50+
echo "url=${URL}" >> $GITHUB_OUTPUT
51+
echo "sha256=${SHASUM}" >> $GITHUB_OUTPUT
52+
echo "Event: ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY
53+
echo "Version: ${VERSION}" >> $GITHUB_STEP_SUMMARY
54+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
55+
echo "Mode: Audit only (PR)" >> $GITHUB_STEP_SUMMARY
56+
else
57+
echo "Mode: Audit and deploy" >> $GITHUB_STEP_SUMMARY
58+
fi
59+
60+
- name: Update formula (for tag events)
61+
if: github.ref_type == 'tag'
62+
run: |
63+
/usr/bin/sed -i '' "s@^ url \".*\"@ url \"${{ steps.meta.outputs.url }}\"@" packaging/homebrew/mfc.rb
64+
/usr/bin/sed -i '' "s@^ sha256 \".*\"@ sha256 \"${{ steps.meta.outputs.sha256 }}\"@" packaging/homebrew/mfc.rb
65+
66+
- name: Setup Homebrew
67+
uses: Homebrew/actions/setup-homebrew@master
68+
69+
- name: Audit/style formula before pushing
70+
run: |
71+
brew style packaging/homebrew/mfc.rb
72+
# Create temporary tap to audit the formula
73+
brew tap-new mfc/local
74+
cp packaging/homebrew/mfc.rb "$(brew --repository)/Library/Taps/mfc/homebrew-local/Formula/mfc.rb"
75+
brew audit --online --strict --new --except=homepage mfc/local/mfc || brew audit --online mfc/local/mfc
76+
brew untap mfc/local
77+
78+
- name: Clone or bootstrap tap repository
79+
if: github.event_name != 'pull_request'
80+
env:
81+
TAP_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}
82+
run: |
83+
set -euo pipefail
84+
REPO="https://x-access-token:${TAP_TOKEN}@github.com/MFlowCode/homebrew-mfc.git"
85+
if git ls-remote "${REPO}" HEAD >/dev/null 2>&1; then
86+
git clone "${REPO}" tap-repo
87+
else
88+
# Repo exists but might be empty; fall back to bootstrap
89+
mkdir -p tap-repo
90+
cd tap-repo
91+
git init -b main
92+
git remote add origin "${REPO}"
93+
touch .keep
94+
git add .keep
95+
git -c user.name="github-actions[bot]" -c user.email="github-actions[bot]@users.noreply.github.com" commit -m "Initialize tap"
96+
git push -u origin main
97+
fi
98+
99+
- name: Copy formula and README into tap
100+
if: github.event_name != 'pull_request'
101+
run: |
102+
mkdir -p tap-repo/Formula
103+
cp packaging/homebrew/mfc.rb tap-repo/Formula/mfc.rb
104+
cp packaging/homebrew/README.md tap-repo/README.md
105+
106+
- name: Commit & push if changed
107+
if: github.event_name != 'pull_request'
108+
env:
109+
TAP_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}
110+
run: |
111+
cd tap-repo
112+
git add Formula/mfc.rb README.md
113+
if git diff --cached --quiet; then
114+
echo "No changes in Formula/mfc.rb or README.md; skipping push."
115+
exit 0
116+
fi
117+
git -c user.name="github-actions[bot]" -c user.email="github-actions[bot]@users.noreply.github.com" \
118+
commit -m "mfc: v${{ steps.meta.outputs.version }}"
119+
git push origin HEAD:main
120+

.github/workflows/frontier/bench.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#!/bin/bash
22

33
n_ranks=12
4-
4+
device_opts=""
55
if [ "$job_device" = "gpu" ]; then
66
gpus=$(rocm-smi --showid | awk '{print $1}' | grep -Eo '[0-9]+' | uniq | tr '\n' ' ')
77
n_ranks=$(echo "$gpus" | wc -w) # number of GPUs on node
88
gpu_ids=$(echo "$gpus" | tr ' ' '\n' | tr '\n' ' ' | sed 's/ $//') # GPU IDs from rocm-smi
9-
device_opts="--gpu -g $gpu_ids"
9+
device_opts+="--gpu"
10+
if [ "$job_interface" = "acc" ]; then
11+
device_opts+=" acc"
12+
elif [ "$job_interface" = "omp" ]; then
13+
device_opts+=" mp"
14+
fi
15+
device_opts+=" -g $gpu_ids"
1016
fi
1117

1218
if [ "$job_device" = "gpu" ]; then

.github/workflows/frontier/build.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
#!/bin/bash
22

3+
job_device=$1
4+
job_interface=$2
5+
run_bench=$3
36
build_opts=""
4-
if [ "$1" = "gpu" ]; then
5-
build_opts="--gpu"
7+
if [ "$job_device" = "gpu" ]; then
8+
build_opts+="--gpu"
9+
if [ "$job_interface" = "acc" ]; then
10+
build_opts+=" acc"
11+
elif [ "$job_interface" = "omp" ]; then
12+
build_opts+=" mp"
13+
fi
614
fi
715

816
. ./mfc.sh load -c f -m g
917

10-
if [ "$2" == "bench" ]; then
18+
if [ "$run_bench" == "bench" ]; then
1119
for dir in benchmarks/*/; do
1220
dirname=$(basename "$dir")
1321
./mfc.sh run "$dir/case.py" --case-optimization -j 8 --dry-run $build_opts

.github/workflows/frontier/submit-bench.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ else
2424
fi
2525

2626

27-
job_slug="`basename "$1" | sed 's/\.sh$//' | sed 's/[^a-zA-Z0-9]/-/g'`-$2"
27+
job_slug="`basename "$1" | sed 's/\.sh$//' | sed 's/[^a-zA-Z0-9]/-/g'`-$2-$3"
2828

2929
sbatch <<EOT
3030
#!/bin/bash
@@ -45,6 +45,7 @@ echo "Running in $(pwd):"
4545
4646
job_slug="$job_slug"
4747
job_device="$2"
48+
job_interface="$3"
4849
4950
. ./mfc.sh load -c f -m g
5051

.github/workflows/frontier/submit.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ else
2525
fi
2626

2727

28-
job_slug="`basename "$1" | sed 's/\.sh$//' | sed 's/[^a-zA-Z0-9]/-/g'`-$2"
28+
job_slug="`basename "$1" | sed 's/\.sh$//' | sed 's/[^a-zA-Z0-9]/-/g'`-$2-$3"
2929

3030
sbatch <<EOT
3131
#!/bin/bash
@@ -46,6 +46,7 @@ echo "Running in $(pwd):"
4646
4747
job_slug="$job_slug"
4848
job_device="$2"
49+
job_interface="$3"
4950
5051
. ./mfc.sh load -c f -m g
5152

.github/workflows/frontier/test.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@
33
gpus=`rocm-smi --showid | awk '{print $1}' | grep -Eo '[0-9]+' | uniq | tr '\n' ' '`
44
ngpus=`echo "$gpus" | tr -d '[:space:]' | wc -c`
55

6+
device_opts=""
67
if [ "$job_device" = "gpu" ]; then
7-
./mfc.sh test -a --rdma-mpi --max-attempts 3 -j $ngpus -- -c frontier
8+
device_opts+="--gpu"
9+
if [ "$job_interface" = "acc" ]; then
10+
device_opts+=" acc"
11+
elif [ "$job_interface" = "omp" ]; then
12+
device_opts+=" mp"
13+
fi
14+
fi
15+
16+
if [ "$job_device" = "gpu" ]; then
17+
./mfc.sh test -a --rdma-mpi --max-attempts 3 -j $ngpus $device_opts -- -c frontier
818
else
919
./mfc.sh test -a --max-attempts 3 -j 32 -- -c frontier
1020
fi

0 commit comments

Comments
 (0)