Xilinx / finn

Dataflow compiler for QNN inference on FPGAs
https://xilinx.github.io/finn
BSD 3-Clause "New" or "Revised" License
753 stars 243 forks source link

[Infra] support passing arguments to build_custom flow #1217

Closed alexhornburg-xlnx closed 1 month ago

alexhornburg-xlnx commented 1 month ago

This enables passing arguments to custom build scripts. e.g. with a build script called test_args.py containing:

import argparse

parser = argparse.ArgumentParser()
parser.add_argument('filename')           # positional argument
parser.add_argument('-c', '--count')      # option that takes a value
parser.add_argument('-v', '--verbose',
                    action='store_true')  # on/off flag
args = parser.parse_args()
print(f"{args.filename=} | {args.count=} | {args.verbose=}")

Can now pass in arguments via run-docker:

./run-docker.sh build_custom .. test_args abc -c 12 -v
...
args.filename='abc' | args.count='12' | args.verbose=True
The program finished and will be restarted
auphelia commented 1 month ago

Thanks @alexhornburg-xlnx !