"git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "8e980f331ba943522f2266a6c32ffcfeb9b1d167"
test_tilelang_example_deepseek_v32.py 1.28 KB
Newer Older
1
# ruff: noqa
2
import tilelang
3
4
import tilelang.testing

5
6
7
8
9
import topk_selector
import fp8_lighting_indexer
import sparse_mla_fwd
import sparse_mla_fwd_pipelined
import sparse_mla_bwd
10
11
12


def test_example_topk_selector():
13
    topk_selector.test_topk_selector()
14
15
16


def test_example_fp8_lighting_indexer():
17
    fp8_lighting_indexer.test_fp8_lighting_indexer(S=512, SKV=1024, H=32, HKV=1, D=64, kv_stride=1)
18
19
20
21
22
23


@tilelang.testing.requires_cuda
@tilelang.testing.requires_cuda_compute_version_ge(9, 0)
def test_example_sparse_mla_fwd():
    # small shapes for testing
24
    sparse_mla_fwd.test_sparse_mla_fwd(
25
        S=256, SKV=1024, H=64, HKV=1, DQK=576, DV=512, topk=256, check_correctness=False)
26
27
28
29
30
31


@tilelang.testing.requires_cuda
@tilelang.testing.requires_cuda_compute_version_ge(9, 0)
def test_example_sparse_mla_fwd_pipelined():
    # small shapes for testing
32
    sparse_mla_fwd_pipelined.test_sparse_mla_fwd_pipelined(
33
        S=256, SKV=512, H=64, HKV=1, DQK=576, DV=512, topk=256, check_correctness=False)
34
35


36
37
38
@tilelang.testing.requires_cuda
@tilelang.testing.requires_cuda_compute_version_ge(9, 0)
def test_example_sparse_mla_bwd():
39
    sparse_mla_bwd.test_sparse_mla_bwd(
40
        S=256, SKV=512, H=64, HKV=1, DQKV=576, DV=512, topk=256, check_correctness=False)
41
42


43
44
if __name__ == "__main__":
    tilelang.testing.main()