Skip to content

Commit 1b097f0

Browse files
Merge pull request #8 from bin913/add_run_op_cicd
Add run_op.sh in backend_test.yaml for cicd
2 parents 34d2465 + 062fc57 commit 1b097f0

6 files changed

Lines changed: 21 additions & 22 deletions

File tree

.github/workflows/unittest.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ jobs:
1212
preprocess:
1313
runs-on: ubuntu-latest
1414
outputs:
15-
labels: ${{ fromJSON(steps.get-labels.outputs.result) }}
15+
changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
1616
pr_id: ${{ steps.get-pr-id.outputs.PR_ID }}
17+
labels: ${{ fromJSON(steps.get-labels.outputs.result) }}
1718
steps:
19+
- id: changed-files
20+
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
1821
- uses: actions/checkout@v4
1922

2023
- id: wait-for-triage
@@ -75,3 +78,4 @@ jobs:
7578
runner_label: 'h100'
7679
gpu_check_script: 'tools/check_nvidia_gpu.sh'
7780
pr_id: ${{ needs.preprocess.outputs.pr_id }}
81+
changed_files: ${{ join(needs.preprocess.outputs.changed_files, ' ') }}

conf/operators.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ ops:
5454
for:
5555
- sabs
5656
labels:
57-
- abs
57+
- sabs
5858
kind:
5959
- BLAS
6060
stages:
@@ -66,7 +66,7 @@ ops:
6666
for:
6767
- dabs
6868
labels:
69-
- abs
69+
- dabs
7070
kind:
7171
- BLAS
7272
stages:
@@ -78,7 +78,7 @@ ops:
7878
for:
7979
- cabs
8080
labels:
81-
- abs
81+
- cabs
8282
kind:
8383
- BLAS
8484
stages:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ dependencies = [
3030
[project.optional-dependencies]
3131
test = [
3232
"pytest>=7.1.0",
33+
"coverage==7.13.5",
3334
"numpy>=1.26",
3435
"scipy>=1.14",
3536
"cupy-cuda12x",

tests/conftest.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,11 @@ def pytest_addoption(parser):
3636
help="device to run reference tests on",
3737
)
3838
parser.addoption(
39-
(
40-
"--mode"
41-
if not (flag_blas.vendor_name == "kunlunxin" and torch.__version__ < "2.5")
42-
else "--fg_mode"
43-
), # TODO: fix pytest-* common --mode args,
44-
action="store",
45-
default="normal",
39+
"--quick",
40+
action="store_true",
41+
default=False,
4642
required=False,
47-
choices=["normal", "quick"],
48-
help="run tests on normal or quick mode",
43+
help="run tests on quick mode",
4944
)
5045
parser.addoption(
5146
"--record",
@@ -86,7 +81,7 @@ def pytest_configure(config):
8681
print(f"[correctness] reference backend: {ref_backend}", flush=True)
8782

8883
global QUICK_MODE
89-
QUICK_MODE = config.getoption("--mode") == "quick"
84+
QUICK_MODE = config.getoption("--quick")
9085

9186
global RECORD_LOG
9287
RECORD_LOG = config.getoption("--record") == "log"

tests/test_sgemm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def test_sgemm_empty(m, n, k):
203203

204204
@pytest.mark.sgemm
205205
@pytest.mark.parametrize(
206-
"alpha,beta", [(1.0, 0.0), (2.0, 0.0), (2.0, 0.5), (0.0, 1.0), (0.5, 1.5)]
206+
"alpha,beta", [(1.0, 0.0), (2.0, 0.0), (2.0, 0.5), (0.0, 1.0), (0.5, 2.5)]
207207
)
208208
def test_sgemm_alpha_beta(alpha, beta):
209209
m, n, k = 256, 256, 256

tools/setup_vendor.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,15 @@ echo "Installing FlagBLAS for ${VENDOR} ..."
2929
case $VENDOR in
3030
nvidia)
3131
# Install PyTorch and Triton with CUDA support
32-
uv pip install --index ${FLAGOS_PYPI} \
33-
"torch==2.9.1+cu128" \
34-
"torchvision==0.24.1+cu128"
32+
uv pip install torch==2.9.1 torchvision==0.24.1 torchaudio==2.9.1 \
33+
--index-url https://download.pytorch.org/whl/cu128
3534
# Install FlagBLAS in editable mode
36-
uv pip install -e .
37-
uv pip install ".[test]"
3835

3936
uv pip uninstall triton
40-
uv pip install --index ${FLAGOS_PYPI} \
41-
flagtree==0.5.0
37+
RES="--index-url=https://resource.flagos.net/repository/flagos-pypi-hosted/simple"
38+
python3.12 -m pip install flagtree===0.5.0 $RES
39+
uv pip install -e .
40+
uv pip install ".[test]"
4241
;;
4342

4443
iluvatar)

0 commit comments

Comments
 (0)