Closed calad0i closed 10 months ago
Please make sure to check off these prerequisites before submitting a bug report.
Keras converter crashes when multiple clone operations are required with different precision. PR comes later.
(Sort of) minimal reproduce example:
from keras.layers import Dense, Add inp = keras.Input(shape=(10,)) x = Dense(10)(inp) y = Dense(10)(inp) z = Dense(10)(inp) xy = Add()([x,y]) # 5 xy = Add()([xy,y]) # 5 model = keras.Model(inp, [xy, z]) model_hls = convert_from_keras_model(model, io_type='io_stream', output_dir='/tmp/stream_clone_crash', hls_config = {'Model':{'Precision':'fixed<32,10>', 'ReuseFactor':1}})
Cause: optimization at https://github.com/fastmachinelearning/hls4ml/blob/0d48affe108f9df470950fe08a73bc3b5c3f2338/hls4ml/backends/fpga/passes/clone.py#L30C15-L30C15: When two clone happens with different #outputs, the template generated last time will crash.
Prerequisites
Please make sure to check off these prerequisites before submitting a bug report.
Quick summary
Keras converter crashes when multiple clone operations are required with different precision. PR comes later.
Steps to Reproduce
(Sort of) minimal reproduce example:
Cause: optimization at https://github.com/fastmachinelearning/hls4ml/blob/0d48affe108f9df470950fe08a73bc3b5c3f2338/hls4ml/backends/fpga/passes/clone.py#L30C15-L30C15: When two clone happens with different #outputs, the template generated last time will crash.