Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ jobs:
run: |
python3.12 -m pytest tests/test_pr37_regression.py -v --tb=short

- name: Run topic16 LLVM-codegen regressions
run: |
python3.12 -m pytest \
tests/test_llvm_codegen_topic16.py \
tests/test_topic16_llvm_case_report.py \
-v --tb=short

- name: Generate test visualization page
if: github.ref == 'refs/heads/main'
run: |
Expand Down Expand Up @@ -218,6 +225,14 @@ jobs:
--json benchmark_reports/const_merge_report.json \
--markdown benchmark_reports/const_merge_report.md

# ── 3.1.2 课题16:LLVM 代码生成 case 报告(结构 + llvm-as/opt) ──
- name: Topic 16 LLVM codegen case report
run: |
mkdir -p benchmark_reports
python3.12 benchmarks/run_topic16_llvm_case.py \
--json benchmark_reports/llvm_codegen_report.json \
--markdown benchmark_reports/llvm_codegen_report.md

# ── 3.2 DSL 用例编译 + 模拟基准 ────────────────────────────────────
- name: DSL case compilation benchmarks
run: |
Expand Down Expand Up @@ -363,6 +378,9 @@ jobs:
if [ -f benchmark_reports/const_merge_report.md ]; then
cat benchmark_reports/const_merge_report.md >> $GITHUB_STEP_SUMMARY
fi
if [ -f benchmark_reports/llvm_codegen_report.md ]; then
cat benchmark_reports/llvm_codegen_report.md >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f benchmark_reports/github_summary.md ]; then
cat benchmark_reports/github_summary.md >> $GITHUB_STEP_SUMMARY
Expand Down
23 changes: 23 additions & 0 deletions benchmarks/cases/topic16_llvm_feature.dsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Topic 16 LLVM-codegen feature case.
#
# Deterministic operator chain covering five NN operators (relu, dot,
# matmul, softmax, gelu). The tensor operators are deliberately
# scalar-degenerate (length/all dims = 1): the DSL frontend does not
# materialize operand shapes yet, so larger extents would be rejected by the
# LLVM backend's element-count checks. The canonical lowering structure
# (loop skeleton, getelementptr, MAC fmul/fadd, softmax three passes, gelu
# tanhf call) is emitted regardless of the trip count, and the case report
# asserts those markers.
#
# This case is compiled by the real CompilerDriver with backend="llvm"; it is
# a structural/feature case, not a performance workload.
y = relu(x)
d = dot(a, b, len:1)
c = matmul(m1, m2, m:1, n:1, k:1)
s = softmax(v)
g = gelu(z)
p1 = add(y, d)
p2 = add(c, s)
p3 = add(p2, g)
t = add(p1, p3)
return t
Loading
Loading