Fix FINNLoop MVAU MLO memblock paths#1621
Conversation
STFleming
left a comment
There was a problem hiding this comment.
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...
|
I believe that this issue might be addressed in #1566 also |
(cherry picked from commit be91bb5)
8cc7e47 to
2b27197
Compare
|
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. |
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