Skip to content

Commit df4c0cc

Browse files
Merge branch 'flagos-ai:master' into update-topk_softmax
2 parents 04e5a42 + 4bcaa80 commit df4c0cc

24 files changed

Lines changed: 696 additions & 1094 deletions

.github/CODEOWNERS

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# These owners will be the default owners for everything in
2+
# the repo. Unless a later match takes precedence,
3+
# @global-owner1 and @global-owner2 will be requested for
4+
# review when someone opens a pull request.
5+
6+
/src/flag_gems/* @kiddyjinjin @0x45f
7+
/src/flag_gems/runtime/backend/*
8+
9+
/tests/* @kiddyjinjin @0x45f
10+
/modules_tests/* @kiddyjinjin @0x45f
11+
/benchmark/* @kiddyjinjin @0x45f
12+
13+
14+
/lib/* @zhangpeiyang1 @huangyiqun
15+
/ctests/* @zhangpeiyang1 @huangyiqun
16+
/include/* @zhangpeiyang1 @huangyiqun

.github/workflows/code_scan.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
scan-code-and-report:
1111
runs-on: scan
12+
if: ${{ github.repository == 'Flagopen/FlagGems' }}
1213
concurrency:
1314
group: scan-code-and-report-${{ github.event.pull_request.number || github.ref }}
1415
cancel-in-progress: true

.github/workflows/gems-test-on-hopper.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ jobs:
8787
run_command pytest -s tests/test_special_ops.py && \
8888
run_command pytest -s tests/test_distribution_ops.py
8989
90+
- name: FlagGems convolution ops on hopper
91+
shell: bash
92+
run: |
93+
source "/home/zhangzhihui/miniconda3/etc/profile.d/conda.sh"
94+
conda activate flag_gems
95+
source tools/run_command.sh
96+
run_command pytest -s tests/test_convolution_ops.py
97+
9098
- name: FlagGems utils on hopper
9199
shell: bash
92100
run: |

benchmark/performance_utils.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,7 @@ def set_gems(self, gems_op):
262262
self.gems_op = gems_op
263263

264264
def get_latency(self, op, *args, **kwargs):
265-
if self.is_inplace:
266-
fn = lambda: op(
267-
*[x.clone() if torch.is_tensor(x) else x for x in args], **kwargs
268-
)
269-
else:
270-
fn = lambda: op(*args, **kwargs)
265+
fn = lambda: op(*args, **kwargs)
271266
if self.is_backward:
272267
out = fn()
273268
dout = torch.randn_like(out)

benchmark/test_convolution_perf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ def set_more_shapes(self):
1414
(16, 24, 2048, 96, 7, 1, 3, 2),
1515
(8, 8, 8192, 16, 11, 4, 5, 1),
1616
(4, 4, 16384, 4, 15, 2, 7, 1),
17+
(32, 64, 512, 64, 3, 1, "valid", 1),
18+
(64, 48, 1024, 128, 5, 2, "valid", 1),
19+
(16, 24, 2048, 96, 7, 1, "same", 2),
20+
(8, 8, 8192, 16, 11, 1, "same", 1),
1721
]
1822

1923

@@ -63,6 +67,10 @@ def set_more_shapes(self):
6367
(16, 32, 12, 12, 24, 3, 3, 2, 1, 1),
6468
(16, 32, 24, 24, 24, 3, 3, 2, 2, 2),
6569
(16, 32, 24, 24, 24, 3, 3, 1, 2, 2),
70+
(16, 32, 12, 12, 24, 3, 3, 2, "valid", 1),
71+
(32, 64, 128, 128, 32, 3, 3, 1, "valid", 1),
72+
(16, 32, 24, 24, 24, 3, 3, 1, "same", 2),
73+
(32, 64, 210, 210, 16, 5, 5, 1, "same", 1),
6674
]
6775

6876

benchmark/test_unary_pointwise_perf.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
)
1414
from benchmark.performance_utils import Benchmark, SkipVersion, generate_tensor_input
1515

16+
vendor_name = flag_gems.vendor_name
1617
fp64_is_supported = flag_gems.runtime.device.support_fp64
1718

1819

@@ -90,10 +91,11 @@ def get_tflops(self, op, *args, **kwargs):
9091
],
9192
)
9293
def test_general_unary_pointwise_perf(op_name, torch_op, dtypes):
93-
if op_name in ["celu"] and SkipVersion("torch", "<2.5"):
94-
pytest.skip(
95-
"There is an error in kunlunxin torch 2.0 aten, please use torch 2.5 instead"
96-
)
94+
if vendor_name == "kunlunxin":
95+
if op_name in ["celu"] and SkipVersion("torch", "<2.5"):
96+
pytest.skip(
97+
"There is an error in kunlunxin torch 2.0 aten, please use torch 2.5 instead"
98+
)
9799
bench = UnaryPointwiseBenchmark(op_name=op_name, torch_op=torch_op, dtypes=dtypes)
98100
bench.run()
99101

@@ -139,10 +141,11 @@ def test_general_unary_pointwise_perf(op_name, torch_op, dtypes):
139141
],
140142
)
141143
def test_general_inplace_unary_pointwise_perf(op_name, torch_op, dtypes):
142-
if op_name in ["celu_"] and SkipVersion("torch", "<2.5"):
143-
pytest.skip(
144-
"There is an error in kunlunxin torch 2.0 aten, please use torch 2.5 instead"
145-
)
144+
if vendor_name == "kunlunxin":
145+
if op_name in ["celu_"] and SkipVersion("torch", "<2.5"):
146+
pytest.skip(
147+
"There is an error in kunlunxin torch 2.0 aten, please use torch 2.5 instead"
148+
)
146149
bench = UnaryPointwiseBenchmark(
147150
op_name=op_name, torch_op=torch_op, dtypes=dtypes, is_inplace=True
148151
)

0 commit comments

Comments
 (0)