Get performance estimates without deployment #428
Unanswered
hossein1387
asked this question in
Q&A
Replies: 1 comment 13 replies
-
I do not know if it is helpful but you can try to use It utilizes https://github.com/Xilinx/finn/blob/main/src/finn/transformation/fpgadataflow/set_folding.py which according to docstring:
Example code: from finn.transformation.fpgadataflow.allocate_resources import AllocateResources
from finn.core.modelwrapper import ModelWrapper
model = ModelWrapper(f"{MODEL_PATH}-dataflow_model.onnx")
model = model.transform(AllocateResources(clk_ns=10, fps_target=20, platform="Pynq-Z1"))
model.save(f"{MODEL_PATH}-dataflow_model-folded.onnx") Then you can inspect the resulting model = ModelWrapper(f"{MODEL_PATH}-dataflow_model-folded.onnx")
fc_layers = model.get_nodes_by_op_type("StreamingFCLayer_Batch")
for fcl in fc_layers:
for attr in fcl.attribute:
if attr.name == "cycles_estimate":
print(f"{fcl.name} {attr.name} {attr.i}") The output will be something like this:
I am not sure if this is the best possible solution. Let me know if something is unclear. |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am trying to get some performance estimate of running quantized models on FINN. What I want to do is given an onnx model (a classification model), what would be the throughput of it using FINN? I cam across these code across finn repo: https://github.com/Xilinx/finn-base/blob/52ce94b9f39179189dd44179c460d0b145cafcf1/src/finn/core/throughput_test.py#L115
finn/tests/fpgadataflow/test_fpgadataflow_globalaccpool.py
Line 127 in d1cc9cf
https://github.com/daiki98/finn/blob/b8f1635f557891f60ede71a54ee1f4385f5e1c6a/tests/fpgadataflow/test_fpgadataflow_channelwise_ops.py#L159
However, I am not able to run it. Is there any sample code that I can follow?
Beta Was this translation helpful? Give feedback.
All reactions