BranchCore work #533
Workflow file for this run
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: ACT Backend Tests (float32) | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| env: | |
| PYTHONPATH: ${{ github.workspace }} | |
| # Optional: make TF deterministic-ish and reduce noisy logs | |
| TF_ENABLE_ONEDNN_OPTS: "0" | |
| # Enable CI mode for lightweight installs | |
| ACT_CI_MODE: "true" | |
| jobs: | |
| backend-float32: | |
| name: Backend Tests (float32) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /opt/hostedtoolcache | |
| df -h | |
| - name: Clean pip cache | |
| run: | | |
| pip cache purge | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install coverage torch torchvision onnx onnx2torch "onnx-simplifier" "onnxsim==0.6.5" tensorflow pandas numpy scipy pyyaml tqdm psutil transformers scikit-learn | |
| # Network Generation & Basic Tests | |
| - name: Generate Networks (float32) | |
| run: | | |
| cd ${{ github.workspace }} | |
| coverage run -p -m act.back_end --generate --device cpu --dtype float32 | |
| - name: Run Serialization Tests (float32) | |
| run: | | |
| cd ${{ github.workspace }} | |
| coverage run -p -m act.back_end --test-serialization --device cpu --dtype float32 | |
| - name: Run ACT2Torch Tests (float32) | |
| run: | | |
| cd ${{ github.workspace }} | |
| coverage run -p -m act.pipeline --verify act2torch --device cpu --dtype float32 | |
| - name: Constraint exporter — torchlp LP export over all layer_testing nets | |
| run: | | |
| cd ${{ github.workspace }} | |
| for f in act/back_end/examples/nets/layer_testing_*.json; do | |
| coverage run -p -m act.back_end --verify --network "$f" \ | |
| --solver torchlp --device cpu --dtype float32 | |
| done | |
| # ───────────────────────────────────────────────────────────────── | |
| # Soundness check (TF-agnostic): runs once before per-solver matrix. | |
| # See act-backend-float64.yml for the full rationale. | |
| # ───────────────────────────────────────────────────────────────── | |
| - name: Soundness — counterexample validation (float32) | |
| run: | | |
| cd ${{ github.workspace }} | |
| coverage run -p -m act.pipeline --verify netfactory --validate-soundness --device cpu --dtype float32 | |
| # ───────────────────────────────────────────────────────────────── | |
| # Per-solver matrix. All steps below run on ACT nets generated by | |
| # NetFactory (act/back_end/net_factory.py), not PyTorch models — | |
| # TorchVision E2E lives in act-pipeline-verify.yml. | |
| # `--verify netfactory --validate-soundness` runs unified two-level | |
| # validation for each solver: Level 1 (counterexample cross-check) | |
| # + Level 2 (per-neuron bounds via analyze facts for interval/hybridz, | |
| # dual-forward bounds for dual). All solvers now exercise both levels. | |
| # ───────────────────────────────────────────────────────────────── | |
| # Solver 1: IntervalTF (forward box) + LP cascade | |
| - name: Solver = interval + LP cascade (float32) | |
| run: | | |
| cd ${{ github.workspace }} | |
| coverage run -p -m act.pipeline --verify netfactory --validate-soundness --device cpu --dtype float32 --tf-modes interval --solvers torchlp | |
| # Solver 2: HybridzTF (zonotope forward) + LP cascade | |
| - name: Solver = hybridz + LP cascade (float32) | |
| run: | | |
| cd ${{ github.workspace }} | |
| coverage run -p -m act.pipeline --verify netfactory --validate-soundness --device cpu --dtype float32 --tf-modes hybridz --solvers torchlp | |
| # Solver 3: DualSolver (Wong-Kolter dual backward, no LP cascade) | |
| - name: Solver = dual (Wong-Kolter dual backward, float32) | |
| run: | | |
| cd ${{ github.workspace }} | |
| coverage run -p -m act.pipeline --verify netfactory --validate-soundness --device cpu --dtype float32 --solvers dual | |
| # Spec-kind coverage: RANGE / MARGIN_ROBUST / UNSAFE_LINEAR explicit runs. | |
| - name: Spec-kind coverage (RANGE / MARGIN / UNSAFE_LINEAR via dual + LP) | |
| run: | | |
| cd ${{ github.workspace }} | |
| coverage run -p -m act.pipeline --verify netfactory --validate-soundness --device cpu --dtype float32 --tf-modes interval --solvers torchlp --networks layer_testing_range,layer_testing_margin_robust,resnet_4x3x16x16_8x2x1_1277797607 | |
| coverage run -p -m act.pipeline --verify netfactory --validate-soundness --device cpu --dtype float32 --solvers dual --networks layer_testing_range,layer_testing_margin_robust,layer_testing_unsafe_linear,resnet_4x3x16x16_8x2x1_1277797607 | |
| - name: List example networks (back_end) | |
| run: | | |
| cd ${{ github.workspace }} | |
| coverage run -p -m act.back_end --list-examples | |
| - name: Combine coverage data | |
| if: always() | |
| run: | | |
| cd ${{ github.workspace }} | |
| coverage combine | |
| coverage xml -o coverage.xml | |
| coverage report | |
| - name: Upload coverage to Codecov | |
| if: always() | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| flags: backend-float32 | |
| name: backend-float32 | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |