Skip to content

Commit e8c2058

Browse files
committed
fix: resolve merge conflicts and use monkeypatch in cudnn_convolution tests
2 parents c8762b3 + ad1573a commit e8c2058

783 files changed

Lines changed: 46518 additions & 13956 deletions

File tree

Some content is hidden

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

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: pip
9+
directory: /
10+
schedule:
11+
interval: weekly
12+
13+
- package-ecosystem: github-actions
14+
directory: /
15+
schedule:
16+
interval: weekly
17+
groups:
18+
actions-minor:
19+
update-types:
20+
- minor
21+
- patch

.github/workflows/auto-sync.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Sync to remote site
2+
on:
3+
4+
workflow_dispatch:
5+
6+
# Note: use 'push' because we want to cover both manual push
7+
# and PR merge events.
8+
push:
9+
branches:
10+
- master
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
sync:
17+
strategy:
18+
matrix:
19+
include:
20+
- job_name: sync-to-gitcode
21+
remote: gitcode.com
22+
repository: FlagGems
23+
branch: master
24+
- job_name: sync-to-gitlink
25+
remote: code.gitlink.org.cn
26+
repository: FlagGems
27+
branch: master
28+
name: ${{ matrix.job_name }}
29+
uses: flagos-ai/build-infra/.github/workflows/sync-to-remote.yaml@main
30+
with:
31+
remote: ${{ matrix.remote }}
32+
repository: ${{ matrix.repository }}
33+
branch: ${{ matrix.branch }}
34+
secrets:
35+
GITCODE_SSH_KEY: ${{ secrets.GITCODE_SSH_KEY }}

.github/workflows/backend-test.yaml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,42 +17,55 @@ on:
1717
required: false
1818
type: string
1919
default: ''
20-
test_script:
21-
description: 'Path to test script under tools/'
22-
required: true
23-
type: string
2420
changed_files:
2521
description: 'List of changed files in a PR'
2622
required: false
2723
type: string
2824
default: ''
25+
pr_id:
26+
description: 'ID of the PR'
27+
required: false
28+
type: string
29+
default: ''
30+
test_script:
31+
description: "Temporary parameter for alpha-ops test"
32+
required: false
33+
type: string
34+
default: ''
35+
secrets:
36+
RUNNER_SSH_KEY:
37+
required: true
2938

30-
# NOTE: The following environment variables are for CI runners to
31-
# mitigate the network connection problems. However, this may not work
32-
# if the PR is triggered from a forked repository because in that case
33-
# GitHub doesn't allow the workflow to access any secrets.
34-
# env:
35-
# http_proxy: ${{ secrets.HTTP_PROXY }}
36-
# https_proxy: ${{ secrets.HTTPS_PROXY }}
39+
permissions:
40+
contents: read
3741

3842
jobs:
3943
test:
4044
runs-on: ${{ inputs.runner_label }}
4145
concurrency:
4246
group: >-
43-
op-test-${{ inputs.vendor }}-
44-
${{ github.event.pull_request.number || github.ref }}
47+
op-test-${{ inputs.vendor }}-${{ github.event.pull_request.number || github.ref }}
4548
cancel-in-progress: true
4649
steps:
4750
- uses: actions/checkout@v6
51+
with:
52+
ssh-key: ${{ secrets.RUNNER_SSH_KEY }}
4853
- name: Check GPU availability
4954
if: ${{ inputs.gpu_check_script != '' }}
5055
shell: bash
5156
run: |
5257
bash ${{ inputs.gpu_check_script }}
58+
- name: Test alpha ops
59+
if: ${{ inputs.test_script != '' }}
60+
env:
61+
CHANGED_FILES: ${{ inputs.changed_files }}
62+
shell: bash
63+
run: |
64+
bash ${{ inputs.test_script }} ${{ inputs.vendor }} ${{ inputs.pr_id }}
5365
- name: Run backend tests
66+
if: ${{ inputs.test_script == '' }}
5467
env:
5568
CHANGED_FILES: ${{ inputs.changed_files }}
5669
shell: bash
5770
run: |
58-
bash ${{ inputs.test_script }} ${{ inputs.vendor }}
71+
bash tools/test_backends.sh ${{ inputs.vendor }} ${{ inputs.pr_id }}

.github/workflows/code_scan.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ on:
99
jobs:
1010
scan-code-and-report:
1111
runs-on: scan
12+
permissions:
13+
contents: read
1214
if: ${{ github.repository == 'flagos-ai/FlagGems' }}
1315
concurrency:
1416
group: scan-code-and-report-${{ github.event.pull_request.number || github.ref }}
1517
cancel-in-progress: true
1618
steps:
1719
- name: Checkout code
18-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
1921

2022
- name: Scan gems repo
2123
shell: bash

.github/workflows/coverage.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
ref: gh-pages
2727

2828
- id: download
29-
uses: actions/github-script@v8
29+
uses: actions/github-script@v9
3030
with:
3131
result-encoding: string
3232
script: |
@@ -75,21 +75,29 @@ jobs:
7575
shell: bash
7676
run: |
7777
COV_ID=$(cat ${{ runner.temp }}/artifacts/COVERAGE_ID)
78-
echo "COV_ID=${COV_ID}" > $GITHUB_ENV
78+
# Strip any newline characters to prevent environment variable injection
79+
COV_ID=${COV_ID//$'\r'/}
80+
COV_ID=${COV_ID//$'\n'/}
81+
# Ensure COV_ID only contains safe characters (alphanumerics, underscore, dash)
82+
if ! [[ "$COV_ID" =~ ^[A-Za-z0-9_-]+$ ]]; then
83+
echo "Invalid COVERAGE_ID value: '$COV_ID'" >&2
84+
exit 1
85+
fi
86+
echo "COV_ID=${COV_ID}" > "$GITHUB_ENV"
7987
DATE=${COV_ID:0:8}
8088
81-
rm -fr hugo-docs/static/coverage/${COV_ID}*
82-
mkdir -p hugo-docs/static/coverage/${COV_ID}
83-
mv ${{ runner.temp }}/artifacts/htmlcov/* hugo-docs/static/coverage/${COV_ID}/
89+
rm -fr docs/static/coverage/${COV_ID}*
90+
mkdir -p docs/static/coverage/${COV_ID}
91+
mv ${{ runner.temp }}/artifacts/htmlcov/* docs/static/coverage/${COV_ID}/
8492
85-
mv ${{ runner.temp }}/artifacts/ut-summary.md hugo-docs/content/en/references/test/unit/${DATE}-summary.md
93+
mv ${{ runner.temp }}/artifacts/ut-summary.md docs/content/en/references/test/unit/${DATE}-summary.md
8694
8795
- id: commit-change
8896
if: ${{ steps.download.outputs.result == 'HAS_DATA' }}
8997
run: |
9098
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
9199
git config --local user.name "github-actions[bot]"
92-
git add hugo-docs
100+
git add docs
93101
git commit -a -m "Add coverage data for ${COV_ID}"
94102
95103
- id: push-change

.github/workflows/cpp-op-test.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: cpp-ops
22

3+
permissions:
4+
contents: read
5+
36
on:
47
workflow_call:
58

@@ -9,13 +12,8 @@ jobs:
912
steps:
1013
- uses: actions/checkout@v6
1114
- shell: bash
12-
env:
13-
SKBUILD_CMAKE_ARGS: >
14-
-DFLAGGEMS_BUILD_C_EXTENSIONS=ON
15-
-DCMAKE_C_COMPILER=/usr/bin/gcc-11
16-
-DCMAKE_CXX_COMPILER=/usr/bin/g++-11
1715
run: |
18-
pip install --no-build-isolation -v -e .
16+
CXX=/usr/bin/g++-11 CC=/usr/bin/gcc-11 SKBUILD_CMAKE_ARGS="-DFLAGGEMS_BUILD_C_EXTENSIONS=ON" pip install --no-build-isolation -v -e .
1917
- shell: bash
2018
run: |
2119
cd build/cpython-311/ctests

.github/workflows/daily.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# TODO(Qiming): Enable daily tests for benchmark and all backends
1212

1313
name: daily
14+
permissions:
15+
contents: read
1416

1517
on:
1618
workflow_dispatch:

.github/workflows/hugo-site.yaml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,31 @@ on:
33
push:
44
branches:
55
- gh-pages
6+
67
workflow_dispatch:
8+
9+
workflow_call:
10+
11+
# When coverage data is collected and pushed to gh-pages branch
12+
workflow_run:
13+
workflows:
14+
- coverage
15+
types:
16+
- completed
17+
718
permissions:
819
contents: read
920
pages: write
1021
id-token: write
22+
1123
concurrency:
1224
group: pages
1325
cancel-in-progress: false
26+
1427
defaults:
1528
run:
1629
shell: bash
30+
1731
jobs:
1832
build:
1933
runs-on: ubuntu-latest
@@ -23,53 +37,64 @@ jobs:
2337
HUGO_VERSION: 0.156.0
2438
NODE_VERSION: 24.13.1
2539
TZ: Europe/Oslo
40+
2641
steps:
2742
- name: Checkout
2843
uses: actions/checkout@v6
2944
with:
3045
ref: gh-pages
3146
submodules: recursive
3247
fetch-depth: 0
48+
3349
- name: Setup Go
3450
uses: actions/setup-go@v6
3551
with:
3652
go-version: ${{ env.GO_VERSION }}
3753
cache: false
54+
3855
- name: Setup Node.js
3956
uses: actions/setup-node@v6
4057
with:
4158
node-version: ${{ env.NODE_VERSION }}
59+
4260
- name: Setup Pages
4361
id: pages
44-
uses: actions/configure-pages@v5
62+
uses: actions/configure-pages@v6.0.0
63+
4564
- name: Create directory for user-specific executable files
4665
run: |
4766
mkdir -p "${HOME}/.local"
67+
4868
- name: Install Dart Sass
4969
run: |
5070
curl -sLJO "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
5171
tar -C "${HOME}/.local" -xf "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
5272
rm "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
5373
echo "${HOME}/.local/dart-sass" >> "${GITHUB_PATH}"
74+
5475
- name: Install Hugo
5576
run: |
5677
curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
5778
mkdir "${HOME}/.local/hugo"
5879
tar -C "${HOME}/.local/hugo" -xf "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
5980
rm "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
6081
echo "${HOME}/.local/hugo" >> "${GITHUB_PATH}"
82+
6183
- name: Verify installations
6284
run: |
6385
echo "Dart Sass: $(sass --version)"
6486
echo "Go: $(go version)"
6587
echo "Hugo: $(hugo version)"
6688
echo "Node.js: $(node --version)"
89+
6790
- name: Install Node.js dependencies
6891
run: |
6992
[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true
93+
7094
- name: Configure Git
7195
run: |
7296
git config core.quotepath false
97+
7398
- name: Cache restore
7499
id: cache-restore
75100
uses: actions/cache/restore@v5
@@ -78,31 +103,35 @@ jobs:
78103
key: hugo-${{ github.run_id }}
79104
restore-keys:
80105
hugo-
106+
81107
- name: Build the site
82108
run: |
83-
cd hugo-docs
109+
cd docs
84110
hugo build \
85111
--gc \
86112
--minify \
87113
--baseURL "${{ steps.pages.outputs.base_url }}/" \
88114
--cacheDir "${{ runner.temp }}/hugo_cache"
115+
89116
- name: Cache save
90117
id: cache-save
91118
uses: actions/cache/save@v5
92119
with:
93120
path: ${{ runner.temp }}/hugo_cache
94121
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
122+
95123
- name: Upload artifact
96-
uses: actions/upload-pages-artifact@v3
124+
uses: actions/upload-pages-artifact@v5
97125
with:
98-
path: ./hugo-docs/public
126+
path: ./docs/public
127+
99128
deploy:
129+
runs-on: ubuntu-latest
130+
needs: build
100131
environment:
101132
name: github-pages
102133
url: ${{ steps.deployment.outputs.page_url }}
103-
runs-on: ubuntu-latest
104-
needs: build
105134
steps:
106135
- name: Deploy to GitHub Pages
107136
id: deployment
108-
uses: actions/deploy-pages@v4
137+
uses: actions/deploy-pages@v5

.github/workflows/image-builder.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: image-builder
22

3+
permissions:
4+
contents: read
5+
36
on:
47
schedule:
58
- cron: '0 3 * * *'

0 commit comments

Comments
 (0)