Add parallel functional RTL simulation for MLO - #1644
Draft
klassen9 wants to merge 2 commits into
Draft
Conversation
modified: HDL_STYLE_GUIDE.md modified: PYTHON_STYLE_GUIDE.md modified: ci/README.md modified: ci/finn_ci/plugin.py modified: docker/Dockerfile.finn modified: docker/quicktest.sh modified: docs/README.md modified: docs/finn/command_line.rst modified: docs/finn/conf.py modified: docs/finn/developers.rst modified: docs/finn/getting_started.rst modified: docs/finn/implementation/specialization-rules.rst modified: docs/finn/reference/mem-modes.rst modified: docs/finn/source_code/finn.builder.rst modified: docs/finn/source_code/finn.core.rst modified: docs/finn/source_code/finn.custom_op.fpgadataflow.hls.rst modified: docs/finn/source_code/finn.custom_op.fpgadataflow.rst modified: docs/finn/source_code/finn.custom_op.fpgadataflow.rtl.rst modified: docs/finn/source_code/finn.transformation.fpgadataflow.rst modified: docs/finn/source_code/finn.util.rst modified: docs/finn/verification.rst modified: finn-rtllib/fetch_weights/fetch_weights.sv modified: finn-rtllib/fetch_weights/fetch_weights_wrapper.v modified: finn-rtllib/mlo/address_config.sv modified: finn-rtllib/mlo/address_config_wrapper.v modified: finn-rtllib/mlo/infrastructure/intermediate_frames.sv modified: finn-rtllib/mlo/loop_control.sv new file: finn-rtllib/pad1d/hdl/pad1d.sv new file: finn-rtllib/pad1d/hdl/pad1d_template.v new file: finn-rtllib/softmax_rtl/binopf.sv new file: finn-rtllib/softmax_rtl/int_to_fp32.sv new file: finn-rtllib/softmax_rtl/pwpolyf.sv new file: finn-rtllib/softmax_rtl/pwpolyf_pkg.sv new file: finn-rtllib/softmax_rtl/queue.sv new file: finn-rtllib/softmax_rtl/softmax_wrapper_template.v new file: finn-rtllib/softmax_rtl/softmaxf.sv new file: finn-rtllib/softmax_rtl/softmaxf_pkg.sv modified: finn_xsi/finn_xsi/adapter.py modified: finn_xsi/finn_xsi/sim_engine.py modified: finn_xsi/rtlsim_xsi.cpp modified: notebooks/advanced/4_advanced_builder_settings.ipynb modified: notebooks/end2end_example/cybersecurity/3-build-accelerator-with-finn.ipynb modified: requirements.txt modified: run-docker.sh new file: src/finn/analysis/fpgadataflow/validate_dataflow_conversion.py modified: src/finn/builder/build_dataflow.py modified: src/finn/builder/build_dataflow_config.py new file: src/finn/builder/build_dataflow_phases.py modified: src/finn/builder/build_dataflow_steps.py modified: src/finn/core/rtlsim_exec.py deleted: src/finn/core/throughput_test.py modified: src/finn/custom_op/fpgadataflow/__init__.py modified: src/finn/custom_op/fpgadataflow/hls/hwsoftmax_hls.py modified: src/finn/custom_op/fpgadataflow/hwcustomop.py new file: src/finn/custom_op/fpgadataflow/pad1d.py modified: src/finn/custom_op/fpgadataflow/rtl/__init__.py modified: src/finn/custom_op/fpgadataflow/rtl/elementwise_binary_rtl.py modified: src/finn/custom_op/fpgadataflow/rtl/finn_loop.py new file: src/finn/custom_op/fpgadataflow/rtl/hwsoftmax_rtl.py new file: src/finn/custom_op/fpgadataflow/rtl/pad1d_rtl.py modified: src/finn/custom_op/fpgadataflow/rtl/streamingfifo_rtl.py modified: src/finn/custom_op/fpgadataflow/streamingfifo.py modified: src/finn/custom_op/fpgadataflow/templates.py modified: src/finn/qnn-data/build_dataflow/dataflow_build_config.json modified: src/finn/qnn-data/templates/driver/driver_base.py modified: src/finn/transformation/fpgadataflow/alveo_build.py modified: src/finn/transformation/fpgadataflow/assign_ddr_weight_offsets.py modified: src/finn/transformation/fpgadataflow/convert_to_hw_layers.py modified: src/finn/transformation/fpgadataflow/loop_rolling.py modified: src/finn/transformation/fpgadataflow/make_driver.py modified: src/finn/transformation/fpgadataflow/set_fifo_depths.py modified: src/finn/transformation/fpgadataflow/specialize_layers.py modified: src/finn/transformation/qonnx/qonnx_activation_handlers.py modified: src/finn/util/basic.py modified: src/finn/util/data_packing.py modified: src/finn/util/fpgadataflow.py renamed: src/finn/util/mlo_sim.py -> src/finn/util/rtlsim.py modified: src/finn/util/test.py new file: tests/README.md modified: tests/end2end/test_end2end_bnn_pynq.py modified: tests/end2end/test_end2end_cybsec_mlp.py modified: tests/end2end/test_end2end_mobilenet_v1.py modified: tests/fpgadataflow/test_fifosizing.py modified: tests/fpgadataflow/test_fpgadataflow_convinputgenerator_rtl_dynamic.py modified: tests/fpgadataflow/test_fpgadataflow_finnloop.py modified: tests/fpgadataflow/test_fpgadataflow_ipstitch.py modified: tests/fpgadataflow/test_fpgadataflow_layernorm.py modified: tests/fpgadataflow/test_fpgadataflow_mvau.py new file: tests/fpgadataflow/test_fpgadataflow_pad1d.py modified: tests/fpgadataflow/test_fpgadataflow_shuffle.py modified: tests/fpgadataflow/test_fpgadataflow_softmax.py modified: tests/fpgadataflow/test_fpgadataflow_thresholding_runtime.py modified: tests/fpgadataflow/test_fpgadataflow_upsampler.py new file: tests/fpgadataflow/test_make_driver_minimal_deps.py modified: tests/fpgadataflow/test_runtime_weights.py new file: tests/fpgadataflow/test_validate_dataflow_conversion.py modified: tests/transformation/test_general_transformation.py modified: tests/transformation/test_loop_rolling.py modified: tests/transformation/test_qonnx_to_finn.py modified: tests/util/test_build_dataflow.py modified: tests/util/test_build_dataflow_checks.py new file: tests/util/test_build_dataflow_step_injection.py modified: tests/util/test_config.py modified: tests/util/test_data_packing.py modified: tests/util/test_finn_ci_plugin.py new file: tests/util/test_fpga_flow_tutorial.py new file: tests/util/test_rtlsim_performance.py new file: tests/util/test_slash_link.py new file: tests/util/test_test_helpers.py modified: tutorials/fpga_flow/README.md modified: tutorials/fpga_flow/build.py
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.
Adds an optional, parallel RTL-simulation path for verifying MLO. Instead of simulating the full FINNLoop sequentially, where every loop iteration runs one after another through the intermediate-frames path, this path builds a lightweight stream tap + body stitched IP and simulates all loop iterations concurrently (one process per iteration), plus the boundary (non-loop) regions separately. This substantially cuts verification time for MLO models.
Since functional verification only needs to check each iteration against a known golden frame, the parallel build drops the intermediate_frames block entirely. Iterations become fully independent and are fed their golden input frame + index directly. However, this might therefore not show any issues caused by the intermediate_frames block during simulation.
The nodes outside the loop are handled by treating each FINNLoop as a cut point and recovering the remaining maximal connected subgraphs. Each boundary region is rebuilt as a standalone model, stitched, and rtl-simulated end-to-end against the same golden context.
This PR is dependent on #1607