Skip to content

Instantly share code, notes, and snippets.

@alanvgreen
Created September 14, 2021 01:22
Show Gist options
  • Save alanvgreen/53420020cfbe979ad6835eed75015254 to your computer and use it in GitHub Desktop.
Save alanvgreen/53420020cfbe979ad6835eed75015254 to your computer and use it in GitHub Desktop.
Better filter loading
google/CFU-Playground at 75aabdfa
Summary: obvious priority is to move filter as far outside loop as possible
# Measure Main loop
Counter | Total | Starts | Average | Raw
---------+--------+--------+---------+--------------
0 | 1475M | 27 | 55M | 1474982499
1 | 0 | 0 | n/a | 0
2 | 0 | 0 | n/a | 0
3 | 0 | 0 | n/a | 0
4 | 0 | 0 | n/a | 0
5 | 0 | 0 | n/a | 0
6 | 0 | 0 | n/a | 0
7 | 0 | 0 | n/a | 0
1495M ( 1494824995) cycles total
Profiler reports 1484M for 2D conv, so 9M cycles are not measured here - about 300K/op
# Detailed Measurements
Counter | Total | Starts | Average | Raw
---------+--------+------- -+---------+--------------
0 | 1501M | 27 | 56M | 1501428675
1 | 789M | 31898 | 25k | 789199190
2 | 208k | 18 | 12k | 208038
3 | 40M | 69566 | 571 | 39726988
4 | 90M | 401808 | 64 | 90145055
5 | 0 | 0 | n/a | 0
6 | 0 | 0 | n/a | 0
7 | 0 | 0 | n/a | 0
1521M ( 1521252055) cycles total
Counter 0 - Overall
Counter 1 - filter loads inside main loop > 50% of overall
counter 2 - filter loads outside main loop
Counter 3 - input loads
Counter 4 - post processing
With the change
Counter | Total | Starts | Average | Raw
---------+--------+--------+---------+--------------
0 | 704M | 27 | 26M | 703967503
1 | 1383k | 62 | 22k | 1383146
2 | 0 | 0 | n/a | 0
3 | 68M | 92846 | 733 | 68074384
4 | 83M | 1401808 | 59 | 83122496
5 | 0 | 0 | n/a | 0
6 | 0 | 0 | n/a | 0
7 | 0 | 0 | n/a | 0
Counter 0 - Overall
Counter 1 - total filter loads
Counter 3 - input loads
Counter 4 - post processing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment