Fix flush/barrier - #30
Conversation
1. Kernels that using consumer/producer double buffering (matrix engines) - on lunch we call barrier to stop consumer reading counter to early before producer has reset them. 2. During dequantization weights get flushed from one layer of cache to other, and flush_to_l2 cant flush over 16 lines of weights, this rule was broken multiple times. - flush_to_l2_multi flushes n lines instead of 16. Both fixes are verbatim copy (including comments from q8 kernels)
|
Hi, thanks for the patch. But no. I do not believe you have validated your code - please request remote access at AIF discord
FCC counters are reset across on kernel dispatches. |
correct, but two counters this barrier protects are ready_ctr/consumed_ctr. These are just values in scratchpad. I measured them surviving across dispatch. Since it is a race condition you have to perform multiple tests. these are result of 5 runs of 46 tests without barrier - 46/46, 45/46, 45/46, 45/46, 45/46. Numerical error is different with every ("failing") run. EDIT: only Q4 was tested. Downloading all the weights requires some time, I might come back on this later if its needed to go trough every kernel. Please confirm, what you want for this PR to be validated? Since all this was present in q8 engine that was allready reviewed #25 (why is it gone?) I tought this would be straight forward so I didn't put much effort in detailed results. I will try to revisit this when I have more time |
|
tested on my machine. Works well. |
Overview
This commit fixes 2 bugs.
Additional information
Both fixes are verbatim copy (including comments from q8 kernels #25). Tracking history there was mul_mat kernel for q8, lost after rewrite (?) This changes were encountered on mul_mat_Q4_0_matrix_engine. Fix was tested and verified. Other kernels weren't tested.
Both bugs were showing up under specific conditions
Requirements