CI: route Bambu tests to a dedicated image - #1511
Draft
nghielme wants to merge 10 commits into
Draft
Conversation
…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.
This was referenced Jul 23, 2026
nghielme
force-pushed
the
pr3-ci
branch
2 times, most recently
from
July 24, 2026 00:20
a47f39b to
b07bed1
Compare
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.
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
mainbecauseits 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-onlynodeids excluded from the standard image via
--ci-exclude-nodeid.ci-template-bambu.yml— Bambu job template gated byrules:($BAMBU_CI == "1"orthe namespace owning the self-hosted runner).
its exclude flag.
Stack & dependencies
Part of a three-PR stack, review in order:
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
Tests
Ran
generate_ci_yaml.pyand inspected the emittedpytests.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 testlabel. This PR is exactly the config that routes the Bambucases; the Bambu jobs are gated (private image,
$BAMBU_CI/ owning namespace) so theyonly 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 ingenerate_ci_yaml.pyand 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
pre-commiton the files I edited or added.