Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Builder] Optional YAML based build configuration flow #35

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

bwintermann
Copy link

@bwintermann bwintermann commented Jan 30, 2025

Draft for a YAML based build file, replacing the need for Python scripts, but not replacing it (keeping backwards compatibility, so writing a build.py script is still possible in case your build flow is more complicated). Would work on this occasionally unless @iksnagreb already has something similar.

I think it would be cleaner and presents a nice interface with software written around it which does not necessarily use Python.

Tasks that would need to be done:

  • YAML to BuildDataflowCfg conversion function
  • Integration into run-docker.sh so that the correct FINN function is called (ideally you can pass both build.py and build.yaml to ./run-docker.sh build_custom and the script automatically can differentiate)
  • Implement every option that BuildDataflowCfg has to be settable by the YAML file
  • Replace print statements by logger statements when First set of small QOL improvements #14 is merged
  • Tests for the conversion function

An example build.yaml could look like this:

config:
  general:
    synth_clk_period_ns: 5.5
    board: U280
    platform: Alveo
    vitis_opt_strategy: PERFORMANCE
    specialize_layers_config_file: specialization.json
    folding_config_file: folding.json
    generate_outputs:
        - BITFILE
        - DEPLOYMENT_PACKAGE
        - ...
  
  build_steps:
    - step_convert_qonnx
    - step_streamline
    - step_create_dataflow_partition
    - step_specialize_layers
    - step_generate_estimate_reports
    - step_hw_codegen
    - step_hw_ipgen
    - custom_steps.step_my_great_function
    - ...

@bwintermann bwintermann self-assigned this Jan 30, 2025
@iksnagreb
Copy link

unless @iksnagreb already has something similar.

I actually kind of already have, except for the build_steps as these sometimes require stuff computed/inserted/configured from other sources which is not easy to do with static YAML configuration (some of my custom build steps are actually build step generators...). However, the way I currently handle the YAML-based config is to simply **config into the DataflowBuildConfig, so there is probably something to refine... I will have a look at your draft, maybe we could/should discuss this further. I am also not sure what @fpjentzsch might already have in place in terms of JSON-based infrastructure...

@bwintermann
Copy link
Author

Sounds great, lets maybe discuss this futher next week, maybe we can make it flexible enough to even allow build steps generator in the YAML itself. I think in terms of JSON this should be easy to integrate since we can quite easily convert the two formats into each other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants