-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quartus multi out with stream fix #908
Quartus multi out with stream fix #908
Conversation
Does this work correctly if the multiple outputs have a different type? I am worried that they get forced to |
It is these lines that make me concerned about the output types when there are multiple outputs: |
@jmitrevs Those lines were also problematic in our attempts to split the writing into multiple IPs. There's no practical reason for this feature to exist, it is merely to be human readable from the very ancient times, and in my (limited) tests everything still works if they are removed |
I just tried: def test_multi_clone(model, data, backend: str, io_type: str):
output_dir = str(test_root_path / f'hls4mlprj_multiout_network_{backend}_{io_type}')
hls_config = config_from_keras_model(model, "name", default_precision='fixed<32,5>')
hls_config["LayerName"]["dense_linear"]["Precision"]["result"] = 'fixed<35,5>'
hls_config["LayerName"]["dense_1_linear"]["Precision"]["result"] = 'fixed<40,5>'
hls_config["LayerName"]["dense"]["Precision"]["result"] = 'fixed<35,5>'
hls_config["LayerName"]["dense_1"]["Precision"]["result"] = 'fixed<40,5>'
model_hls = convert_from_keras_model(
model, backend=backend, output_dir=output_dir, hls_config=hls_config, io_type=io_type
)
model_hls.compile()
r_hls = model_hls.predict(data)
r_keras = [x.numpy() for x in model(data)]
assert np.allclose(r_hls[0], r_keras[0], atol=1e-5, rtol=0)
assert np.allclose(r_hls[1], r_keras[1], atol=1e-5, rtol=0) and both outputs are |
I changed the two places in |
There is still some manual seeding left, if I looked at the code correctly. |
@calad0i, can you remove the remaining seed setting? |
Actually, let me run pytests first again. So hold off on the merge.
Generally other that the test_root_path issue, I think this is good. After that is fixed we can merge it. |
A# Description
Quartus writer writes uncompilable programs when there are multiple outputs with io_stream. This PR fixes that.
Type of change
Tests
test/pytest/test_multiout_network.py
Test Configuration:
Checklist
pre-commit
on the files I edited or added.