Repository navigation
simplify: CI 恢复简洁模式,benchmark job 追加 LLVM+TinyFive 分析步骤 #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, wjy_dev, jzj_dev] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| # ═════════════════════════════════════════════════════════════════════════ | |
| # 课题功能测试:所有14个模块的单元测试 + 集成测试 | |
| # ═════════════════════════════════════════════════════════════════════════ | |
| test: | |
| runs-on: self-hosted | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| python3.12 -m pip install --upgrade pip | |
| python3.12 -m pip install -e ".[all]" | |
| - name: Run all topic tests | |
| run: python3.12 -m pytest tests/ -v --tb=short | |
| # ═════════════════════════════════════════════════════════════════════════ | |
| # 模型性能测试:ONNX模型管线 + DSL用例 + CNN RISC-V编译 | |
| # ═════════════════════════════════════════════════════════════════════════ | |
| benchmark: | |
| runs-on: self-hosted | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| python3.12 -m pip install --upgrade pip | |
| python3.12 -m pip install -e ".[all]" | |
| # ── 3.1 ONNX 模型管线基准测试 ────────────────────────────────────── | |
| - name: ONNX model pipeline benchmarks | |
| run: python3.12 -m pytest benchmarks/test_benchmark.py -v --tb=short | |
| # ── 3.2 DSL 用例编译 + 模拟基准 ──────────────────────────────────── | |
| - name: DSL case compilation benchmarks | |
| run: | | |
| mkdir -p benchmark_reports | |
| python3.12 benchmarks/bench_runner.py benchmarks/cases \ | |
| --output-json benchmark_reports/dsl_bench.json \ | |
| --output-html benchmark_reports/dsl_bench.html \ | |
| --output-md benchmark_reports/dsl_bench.md | |
| # ── 3.3 CNN RISC-V 编译 + 性能估算(模型存在才跑)───────────────── | |
| - name: CNN RISC-V compilation & estimation | |
| run: | | |
| if [ -f models/graph/cnn.onnx ]; then | |
| mkdir -p benchmark_reports | |
| python3.12 scratchv/standalone/onnx_to_riscv_standalone.py \ | |
| models/graph/cnn.onnx \ | |
| -o /tmp/cnn_riscv.bin \ | |
| --estimate \ | |
| --report | |
| else | |
| echo "models/graph/cnn.onnx not found, skipping CNN benchmark" | |
| fi | |
| # ── 3.4 LLVM vs ScratchV + TinyFive 对比(纯分析,无需编译)────── | |
| - name: LLVM vs ScratchV comparison (analytical) | |
| run: | | |
| mkdir -p benchmark_reports | |
| python3.12 scratchv/standalone/llvm_cache_compare.py \ | |
| --json-output benchmark_reports/llvm_vs_scratchv.json \ | |
| --markdown benchmark_reports/llvm_vs_scratchv.md 2>&1 | tail -20 | |
| python3.12 scratchv/standalone/tinyfive_compare.py \ | |
| --json benchmark_reports/tinyfive_compare.json \ | |
| --markdown benchmark_reports/tinyfive_compare.md 2>&1 | tail -15 | |
| # ── 上报 ────────────────────────────────────────────────────────── | |
| - name: Upload benchmark reports | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-reports | |
| path: benchmark_reports/ | |
| retention-days: 30 | |
| - name: Write job summary | |
| run: | | |
| if [ -f benchmark_reports/github_summary.md ]; then | |
| cat benchmark_reports/github_summary.md >> $GITHUB_STEP_SUMMARY | |
| fi | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### LLVM vs ScratchV" >> $GITHUB_STEP_SUMMARY | |
| if [ -f benchmark_reports/llvm_vs_scratchv.md ]; then | |
| tail -20 benchmark_reports/llvm_vs_scratchv.md >> $GITHUB_STEP_SUMMARY | |
| fi |