-
Notifications
You must be signed in to change notification settings - Fork 17
fix_float64 not passed if cleanup is run #63
Comments
A simple onnx file that shows this behavior is hare: https://drive.google.com/file/d/16Opd4K3xjEEp9jgmmkZgqW5fXCFJ84lA/view?usp=sharing (github doesn't allow me to upload onnx files) The standard way to initiate this problem is with: qonnx.util.cleanup.cleanup("MLP.onnx", out_file="MLP_clean.onnx")
model = ModelWrapper("MLP_clean.onnx")
X = create_predict_data(model)
idict = {model.graph.input[0].name: X}
y_qonnx = oxe.execute_onnx(model, idict)[model.graph.output[0].name] where create_predict_data basically crates |
I can get the above version of this model to work by setting the default of fix_float64 to false, but interestingly, the same steps do not work for a float version of this model: https://drive.google.com/file/d/1Ogjh7H3X8hpT3qktXs-11lVlZjpDCh_Y/view?usp=sharing For some reason, I get |
Thanks for providing the example models, I can reproduce the issue and I'm looking into a clean solution for this. The origin of the If I remove the workaround completely, we get numerous test failures in FINN. However, for models that actually use
|
I think I found the answer for the question I asked above to @HenniOVP : it's actually not the case that ONNX only accepts 64bit floats as attributes, but rather, the protobuf wrapper for ONNX doesn't recognize numpy float32 (as opposed to native Python float). Working on a fix for that part. |
I was just about to comment something similar. It seems that the issue, which I mentioned in the code only appears with the attributes and not the initializes. So, in fact line 194 should probably be changed to |
In the transform member function of ModelWrapper:
finn-base/src/finn/core/modelwrapper.py
Lines 122 to 146 in 2f10c0c
if
cleanup=True
, then the transform is called withfix_float64=True
during the cleanup, no matter what the transform was originally called with. I think eitherfix_float64
should default to False, orfix_float64
should be passed to the cleanup.The text was updated successfully, but these errors were encountered: