Skip to content

CI: route Bambu tests to a dedicated image - #1511

Draft
nghielme wants to merge 10 commits into
fastmachinelearning:mainfrom
nghielme:pr3-ci
Draft

CI: route Bambu tests to a dedicated image#1511
nghielme wants to merge 10 commits into
fastmachinelearning:mainfrom
nghielme:pr3-ci

Conversation

@nghielme

@nghielme nghielme commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Description

Routes the Bambu-parametrized test cases to a dedicated CI image: the standard image runs
everything except Bambu, the Bambu image runs only Bambu. Needed because the Bambu image
and Bambu itself are private.

Stacked on #1509 (the Bambu backend PR). Opened against main because
its true base branch lives in the fork; the diff includes the backend PR's commits until
that PR merges, then shrinks automatically.

How:

  • generate_ci_yaml.py — Bambu-sharing test files run twice: standard image with
    --backend-exclude=Bambu, Bambu image with --backend-filter=Bambu. Bambu-only
    nodeids excluded from the standard image via --ci-exclude-nodeid.
  • ci-template-bambu.yml — Bambu job template gated by rules: ($BAMBU_CI == "1" or
    the namespace owning the self-hosted runner).
  • Verified the existing QKeras-v3 and pquant jobs are unaffected and no standard job loses
    its exclude flag.

Stack & dependencies

Part of a three-PR stack, review in order:

  1. Add Bambu (PandA) HLS backend #1509 — Bambu backend
  2. Add NanoXplore NG-ULTRA accelerator backend #1510 — NanoXplore NG-ULTRA accelerator backend
  3. CI: route Bambu tests to a dedicated image #1511 — CI routing for Bambu tests (this PR)

Builds on #1509; the whole stack depends on #1448 merging first (vendored in #1509's
first commit, dropped on rebase once #1448 lands).

Type of change

  • Other (Specify) — CI configuration

Tests

Ran generate_ci_yaml.py and inspected the emitted pytests.yml: Bambu jobs use
--backend-filter=Bambu, standard jobs sharing those files carry --backend-exclude=Bambu,
QKeras-v3 and both pquant jobs still emit, no standard job is missing the exclude flag.

CI note

GitHub PR checks here cover pre-commit, the docs build, and the packaging step. The
pytest suite runs on hls4ml's self-hosted GitLab pipeline, triggered by a maintainer
with the please test label. This PR is exactly the config that routes the Bambu
cases; the Bambu jobs are gated (private image, $BAMBU_CI / owning namespace) so they
only execute where that runner exists.

Acknowledgements

The Bambu CI routing is based on work by Marco Colombo (@marco66colombo), who wrote the initial Bambu job generation in generate_ci_yaml.py and the GitLab template and runner plumbing behind it. He also built the pytest-based synthesis CI this extends (#1257) and the Keras 3 test environment (#1412).

Checklist

  • I have read the guidelines for contributing.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have installed and run pre-commit on the files I edited or added.
  • I have added tests that prove my fix is effective or that my feature works.

nghielme added 2 commits July 20, 2026 15:12
…earning#1448)

Vendored here so this branch builds and tests on its own. This code is
NOT part of this PR's contribution -- it is the content of open PR fastmachinelearning#1448
by the same author, on which the Bambu backend depends:

  * parse_vivado_report() split into per-report helpers; bambu_report.py
    reuses _parse_csim_results, _parse_rtl_cosim_results,
    _parse_implementation_report, _parse_timing_report, _parse_power_report
  * PATHS table and _path(), including the vivado_reports/post_route_*.rpt
    locations Bambu writes its own results into
  * statistics.tcl and the vivado_synth.tcl rewrite that produce them

Review it in fastmachinelearning#1448, not here. When fastmachinelearning#1448 merges, rebasing drops this
commit.
Firmware templates, build scripts and the nnet_utils header library used
by the Bambu backend. Two submodules come with them:

  templates/bambu/ac_types        ferrandi/ac_types, Bambu's fork
  templates/bambu/nnet_utils/gcem kthohr/gcem, constexpr math for tables

ac_types diverges from the hlslibs/ac_types already vendored for Catapult,
so it cannot be shared with that backend.
nghielme added 5 commits July 24, 2026 13:55
BambuBackend converts hls4ml models to HLS C++ and drives Bambu/PandA to
synthesizable Verilog, for both io_parallel and io_stream. partname_to_bambu
maps hls4ml part names onto Bambu device names.

Not registered yet -- registration lands with the writer and report modules
it depends on.
bambu_writer.py emits the HLS C++ project; bambu_report.py parses Bambu's
XML results and reuses the Vivado report helpers for the post-route
utilization, timing and power numbers.
Only the Bambu lines: the accelerator layer registers itself separately.
test_build_bambu.py drives csim, cosim, synth and vsynth on the default
Xilinx part. The existing keras/activation/softmax/pooling suites gain
'Bambu' alongside the other backends.

conftest.py grows --backend-filter / --backend-exclude / --ci-exclude-nodeid
so a pipeline without the Bambu toolchain can deselect these cases; the CI
wiring that uses them is a separate PR.
nghielme added 3 commits July 28, 2026 13:32
Picks up six upstream commits on ferrandi/ac_types dev/panda-hls since
35e101a, mostly hls::stream/ac_channel work: DEPTH template parameter on
the stream copy constructor and assignment operator (#3), peek support
(#4), a gcc 15 / system C++ library fix (#5), improved hls::stream
channel data type support (#6), a cosim regression fix (#7), and better
set_slc/set_slc2 (#8).
Since ac_types became a git submodule the headers live under
ac_types/include, not at the top level, so the USE_HLS4ML_AC_TYPES
escape hatch was passing an include path with no headers in it.
generate_ci_yaml.py now splits test files that parametrize both Bambu and
non-Bambu backends. The standard image runs them with
--backend-exclude=Bambu; a .pytest-bambu template runs the same files with
--backend-filter=Bambu in an image carrying the Bambu AppImage.
test_report.py::test_bambu_report is named individually, since it is not
selected by backend parametrization.

Upstream pipelines are unaffected. The Bambu jobs are gated by a rules:
clause -- the owning namespace, or an explicit BAMBU_CI=1 -- and skip
everywhere else, since they need a self-hosted runner with that image. The
generic jobs keep the k8s-default tag.

safe.directory now uses $CI_PROJECT_DIR instead of the hardcoded upstream
project path, so the pipeline also works in a fork.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant