test_tilelang_example_deepseek_v32.py 1.27 KB
Newer Older
1
2
3
# ruff: noqa
import tilelang.testing

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


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


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


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


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


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


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