Skip to content

Fix FINNLoop MVAU MLO memblock paths#1621

Closed
ollycassidy13 wants to merge 1 commit into
Xilinx:devfrom
ollycassidy13:split/finnloop-mvau-memblock-paths
Closed

Fix FINNLoop MVAU MLO memblock paths#1621
ollycassidy13 wants to merge 1 commit into
Xilinx:devfrom
ollycassidy13:split/finnloop-mvau-memblock-paths

Conversation

@ollycassidy13

Copy link
Copy Markdown

Fixes FINNLoop MVAU MLO memblock path generation.
This keeps generated memblock references correct when MVAU nodes are placed inside rolled loop bodies.
Change type: Python

@STFleming STFleming left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ollycassidy13,

Thanks for this submission. I'm currently hitting a few issues with it.

When I try to run the FINN loop tests I am getting the following error:

_____________________________________ ERROR collecting tests/fpgadataflow/test_fpgadataflow_finnloop.py ______________________________________
ImportError while importing test module '/scratch/users/sfleming/finn_prs/olly_tiny_deit_prs/1621/tests/fpgadataflow/test_fpgadataflow_finnloop.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test_fpgadataflow_finnloop.py:21: in <module>
    import finn.builder.build_dataflow as build
../../src/finn/builder/build_dataflow.py:39: in <module>
    from finn.builder.build_dataflow_checks import (
../../src/finn/builder/build_dataflow_checks.py:13: in <module>
    from finn.builder.build_dataflow_config import (
../../src/finn/builder/build_dataflow_config.py:37: in <module>
    from finn.transformation.fpgadataflow.alveo_build import VitisOptStrategy
../../src/finn/transformation/fpgadataflow/alveo_build.py:54: in <module>
    from finn.transformation.fpgadataflow.specialize_layers import SpecializeLayers
../../src/finn/transformation/fpgadataflow/specialize_layers.py:36: in <module>
    from finn.custom_op.fpgadataflow.rtl import custom_op as rtl_variants
../../src/finn/custom_op/fpgadataflow/rtl/__init__.py:37: in <module>
    from finn.custom_op.fpgadataflow.rtl.finn_loop import FINNLoop
../../src/finn/custom_op/fpgadataflow/rtl/finn_loop.py:48: in <module>
    from finn.util.basic import getHWCustomOp, make_build_dir, resolve_xilinx_tool
E   ImportError: cannot import name 'getHWCustomOp' from 'finn.util.basic' (/scratch/users/sfleming/finn_prs/olly_tiny_deit_prs/1621/src/finn/util/basic.py)

The getHWCustomOp is not used on /dev and so shouldn't be used here (and is missing from this tree).

Another wider question, can you give us the exact failure condition where this is happening? Did you have a MVAU that had constant weights across all loop iterations? In MLO I would expect the MVAUs would not use memstream_wrapper.v files...

@STFleming

Copy link
Copy Markdown
Collaborator

I believe that this issue might be addressed in #1566 also

(cherry picked from commit be91bb5)
@ollycassidy13
ollycassidy13 force-pushed the split/finnloop-mvau-memblock-paths branch from 8cc7e47 to 2b27197 Compare July 7, 2026 14:01
@ollycassidy13

Copy link
Copy Markdown
Author

The failure this came from was in a rolled FINNLoop body with loop-varying MVAU parameters: FINNLoop.generate_params concatenates the per-iteration memblock.dat files into memblock_MVAU*id*.dat, but the generated memstream wrapper still referenced the original code_gen_dir_ipgen/memblock.dat path. This was not the “constant weights across all loop iterations” case.

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.

2 participants