Add metric for 3D texture max concurrent cache read (#4421)
Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/4421
This diff introduces a metric to calculate the maximum concurrent cache line accesses for each dimension of a 3D texture. The experiment works by allowing each thread to access a different texel on the texture and slowly increasing the number of threads, until the cache line is no longer able to handle all simultaneous accesses. By detecting a jump in latency, we can define the optimal maximum size that can be accessed concurrently on each dimension.
NOTE: ArchProbe uses this information to[ obtain a supposed cache line size for textures](https://fburl.com/98xiou3g). However, it is unclear why they define the cache line size as being the ratio between the larger concurrency value over the lower, times the texel size. It is also unclear how to extend their calculations to three dimensions.
TODO: Understand the relationship between concurrency and cache line size, and modify this metric to output the cache line size.
For a Samsung S22, the latency graph looks like this:
{F1780375117}
Reviewed By: copyrightly
Differential Revision: D60246121
fbshipit-source-id: c2bac010077bf14e95f70bb6038acbb47a534dde E
Esteban Padilla Cerdio committed
5867129887571ea6f4c064f5447702e77135a923
Parent: 298b625
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 7/30/2024, 8:31:12 PM