Skip to content

Commit

Permalink
Add running of LIT test to CI (#49)
Browse files Browse the repository at this point in the history
Signed-off-by: Stanley Winata <stanley.winata@amd.com>
  • Loading branch information
raikonenfnu authored Jul 26, 2024
1 parent da36f78 commit 09f0a3b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ jobs:
run: |
pytest -n 4 .
- name: Run LIT tests
if: ${{ !cancelled() }}
run: |
lit lit_tests/
- name: MyPy Type Checking
if: ${{ !cancelled() }}
run: |
Expand Down
28 changes: 14 additions & 14 deletions lit_tests/kernel/wave/expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_read_write_equal_sizes():
# CHECK-NEXT: %read_0_1
# CHECK-SAME: (%a, 4)
# CHECK-NEXT: %write_0_0
# CHECK-SAME: (%read, %c, 4)
# CHECK-SAME: (%read_0_0, %c, 4)
# CHECK-NEXT: %write_1_1
# CHECK-SAME: (%read_1_1, %c, 4)
# CHECK-NEXT: %write_1_0
Expand Down Expand Up @@ -196,13 +196,13 @@ def test_gemm():
# CHECK-NEXT: %getresult_0_1_0
# CHECK-NEXT: %getresult_0_0_0
# CHECK-NEXT: %write_0_0_0
# CHECK-SAME: (%get_result_0_0_0, %c, 4)
# CHECK-SAME: (%getresult_0_0_0, %c, 4)
# CHECK-NEXT: %write_1_1_0
# CHECK-SAME: (%get_result_1_1_0, %c, 4)
# CHECK-SAME: (%getresult_1_1_0, %c, 4)
# CHECK-NEXT: %write_1_0_0
# CHECK-SAME: (%get_result_1_0_0, %c, 4)
# CHECK-SAME: (%getresult_1_0_0, %c, 4)
# CHECK-NEXT: %write_0_1_0
# CHECK-SAME: (%get_result_0_1_0, %c, 4)
# CHECK-SAME: (%getresult_0_1_0, %c, 4)

# Reduction subgraph:

Expand Down Expand Up @@ -232,7 +232,7 @@ def test_gemm():
# CHECK-SAME: (%b, 4)

# CHECK-NEXT: %mma_0_0_0
# CHECK-SAME: (%read_0_0_0, %read_0_0_0, %acc)
# CHECK-SAME: (%read_0_0_0, %read_0_0_0, %acc_0_0_0)
# CHECK-NEXT: %mma_0_0_1
# CHECK-SAME: (%read_0_0_1, %read_0_0_1, %mma_0_0_0)
# CHECK-NEXT: %mma_1_1_0
Expand Down Expand Up @@ -283,9 +283,9 @@ def test_gemm_reduction_expansion_only():
# CHECK-NEXT: %getresult_0_1_0
# CHECK-NEXT: %getresult_0_0_0
# CHECK-NEXT: %write_0_0_0
# CHECK-SAME: (%get_result_0_0_0, %c, 4)
# CHECK-SAME: (%getresult_0_0_0, %c, 4)
# CHECK-NEXT: %write_0_1_0
# CHECK-SAME: (%get_result_0_1_0, %c, 4)
# CHECK-SAME: (%getresult_0_1_0, %c, 4)

# Reduction subgraph:

Expand Down Expand Up @@ -325,17 +325,17 @@ def test_gemm_reduction_expansion_only():
# CHECK-NEXT: %mma_0_0_1
# CHECK-SAME: (%read_0_0_1, %read_0_0_1, %mma_0_0_0)
# CHECK-NEXT: %mma_0_0_2
# CHECK-SAME: (%read_0_0_1, %read_0_0_1, %mma_0_0_1)
# CHECK-SAME: (%read_0_0_2, %read_0_0_2, %mma_0_0_1)
# CHECK-NEXT: %mma_0_0_3
# CHECK-SAME: (%read_0_0_1, %read_0_0_1, %mma_0_0_2)
# CHECK-SAME: (%read_0_0_3, %read_0_0_3, %mma_0_0_2)
# CHECK-NEXT: %mma_0_1_0
# CHECK-SAME: (%read_1_0_0, %read_0_1_0, %acc_0_1_0)
# CHECK-SAME: (%read_0_0_0, %read_0_1_0, %acc_0_1_0)
# CHECK-NEXT: %mma_0_1_1
# CHECK-SAME: (%read_1_0_1, %read_0_1_1, %mma_0_1_0)
# CHECK-SAME: (%read_0_0_1, %read_0_1_1, %mma_0_1_0)
# CHECK-NEXT: %mma_0_1_2
# CHECK-SAME: (%read_1_0_1, %read_0_1_1, %mma_0_1_1)
# CHECK-SAME: (%read_0_0_2, %read_0_1_2, %mma_0_1_1)
# CHECK-NEXT: %mma_0_1_3
# CHECK-SAME: (%read_1_0_1, %read_0_1_1, %mma_0_1_2)
# CHECK-SAME: (%read_0_0_3, %read_0_1_3, %mma_0_1_2)

# CHECK-NEXT: return [mma_0_0_3, mma_0_1_3]

Expand Down
2 changes: 1 addition & 1 deletion lit_tests/kernel/wave/promotion.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def test_gemm():
# CHECK-NEXT: %write_1
# CHECK-SAME: (%read_1, %allocate_1, 4)
# CHECK-NEXT: %read_3
# CHECK-SAME: (%allocate, 4)
# CHECK-SAME: (%allocate_1, 4)
# CHECK-NEXT: %mma
# CHECK-SAME: (%read_2, %read_3, %acc)

Expand Down
8 changes: 4 additions & 4 deletions lit_tests/kernel/wave/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test(a: tkl.Memory[M, N, ADDRESS_SPACE, tkl.f16]):

# Custom format:
# CHECK-NEXT: placeholder
# CHECK-SAME: MemoryType[M, N].of(f16)
# CHECK-SAME: _type=Memory[M, N].of(f16)
# CHECK-NEXT: output


Expand Down Expand Up @@ -77,7 +77,7 @@ def test(a: tkl.Memory[M, N, ADDRESS_SPACE, tkl.f16]):

# Custom format:
# CHECK-NEXT: placeholder
# CHECK-SAME: MemoryType[M, N].of(f16)
# CHECK-SAME: _type=Memory[M, N].of(f16)
# CHECK-NEXT: read(memory=a
# CHECK-NEXT: write(register_=read, memory=a
# CHECK-NEXT: output
Expand Down Expand Up @@ -167,8 +167,8 @@ def test(

# Custom format:
# CHECK-NEXT: placeholder
# CHECK-NEXT: read
# CHECK-NEXT: read
# CHECK-NEXT: read(memory=a
# CHECK-NEXT: read(memory=a
# CHECK-NEXT: register
# CHECK-NEXT: mma
# CHECK-NEXT: output
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build/test requirements.
Jinja2==3.1.3
filecheck==0.0.24
filecheck==1.0.0
numpy==1.26.3
parameterized==0.9.0
pytest==8.0.0
Expand Down

0 comments on commit 09f0a3b

Please sign in to comment.