-
Notifications
You must be signed in to change notification settings - Fork 136
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
hps_accel: max pool fails golden tests #451
Comments
Commenting out this line in the Makefile causes golden tests to pass on hardware
|
@kgugala could you look into this, please |
I tried building the design with Radiant, but Radiant (using both LSE and Synplify Pro) tries to use too many DSP resources:
If looks like the systolic array (32 9x9) and post processor (1 36x36) multipliers are correctly synthesized, but the VexRiscV multiplier incorrectly uses 2 18x18 and 2 18x36 instead of 4 18x18 multipliers. |
To be clear (I miswrote earlier): tests fail on hardware and pass in verilator. |
@alanvgreen There is a possibility to set the maximum DSP usage in LSE. For instance the following sets the DSP usage to 30%
I did try higher values, but it turns out that still the total number of DSPs was exceeding the limit. Of course reducing the DSP usage will necessarily yield higher logic resources utilization, so it is possible that the pnr tool could have a hard time finding a valid solution. (In the GUI, this option is found under |
I have confirmed - via printf() - that the right values go into the CFU and the wrong values come out. |
@acomodi Thanks for the tip! I was able to get Radiant to produce a bitstream, however the bitstream didn't work - the FPGA seems unresponsive. I'm not inclined to spend any more time on it right now. |
Findings from @acomodi (copied from chat) : Running test pool 03
I have modified the test in software to output also all the memory locations where the difference is spotted and it seems there is a repeating pattern. Every 320 words starting from 1597, there is a difference |
I then ran the Verilator simulation with post-Yosys Verilog, and found that it failed the same 4 times as hardware. Pre-Yosys simulation (using the Verilog generated by nMigen) did not show the failures. |
Looking at a window of inputs around the first failure, I noted that the failure was the only time that there were positive bytes (each 32b word is 4 signed bytes). So, I checked if there were any cases of positive bytes in the entire input that resulted in correct output. There was not. Every time there were positive bytes, the result was incorrect. Alan will try a workaround to add 128 to each byte operand so that they can be compared with an unsigned comparator. I'll try to find the root cause of why the signed comparisons are not working correctly after Yosys processing, and submit a reduced testcase to Yosys if appropriate. |
The unsigned comparison also fails on hardware but passes in software. Interestingly the failures are now different. The unit test case (3-a on the menu) now passes, but golden tests fail. |
When using the unsigned comparison workaround, I noticed that the remaining errors disappeared if I added |
There is a fix in Yosys overnight in response to my issue: https://github.com/YosysHQ/yosys/pull/3188/files. It appears to fix the version that uses unsigned comparisons. |
The Yosys fix also fixes the original MaxPool gateware. Closing this issue. |
hps_accel is exhibiting strange behavior.
To reproduce:
make load PLATFORM=sim
) - tests pass.The text was updated successfully, but these errors were encountered: