-
Notifications
You must be signed in to change notification settings - Fork 525
Open
Labels
Description
Quick summary
test_softmax.pydoes not actually test non-default implementations (argmaxandlatency).- If we fix that, tests for
latencyfail, reporting low accuracy.
Details
Steps to Reproduce
- Clone the hls4ml repository
- Checkout the main branch, commit hash: 6900257
- Run
pytest test/pytest/test_softmax.py - Go e.g. to
test/pytest/test_softmax_test_softmax_9,6-input_shape6-18,8-io_parallel-False-latency-Vivado/parameters.h, line 29, see:
static const nnet::softmax_implementation implementation = nnet::softmax_implementation::stable;
instead of expected nnet::softmax_implementation::latency.
- Now, if we replace the line
hls4ml/test/pytest/test_softmax.py
Line 47 in 6900257
cfg['LayerName']['softmax']['Strategy'] = strategy
with
cfg['LayerName']['softmax']['implementation'] = strategy
then all latency tests fail with messages like:
Accuracy hls4ml relative to keras: 0.1908
- Now, if we replace
hls4ml/test/pytest/test_softmax.py
Line 19 in 6900257
return np.clip(d, -32, 31)
with
return np.clip(d, -32, 0)
the the tests pass.
(Catapult backend fails on my laptop because it doesn't create .so file, but that's unrelated).
Reactions are currently unavailable