Commit 552a31f
ssjia
[ET-VK] Fix staging buffer allocation to check all memory types for HOST_CACHED
`test_host_cached_available()` only checked `memoryTypes[0]` to determine if
HOST_CACHED memory was available. On Pixel devices, `memoryTypes[0]` is
DEVICE_LOCAL without HOST_CACHED, so the function incorrectly returned
`SEQUENTIAL_WRITE_BIT`. This caused DEVICE_TO_HOST staging buffers to be
allocated in write-combining (uncached) memory, making CPU reads during
COPY_OUTPUTS ~170x slower than necessary (~40ms vs ~237us on S24).
The fix iterates over all memory types to correctly detect HOST_CACHED support.
On-device profiling of edgetam_first_frame_fp16_vulkan.pte confirms the fix:
- Pixel 8 Pro COPY_OUTPUTS: 40ms -> 6.3ms (-84%)
- Pixel 9 Pro XL COPY_OUTPUTS: 40ms -> 2.5ms (-94%)
- Pixel 8 Pro Method::execute: 492ms -> 464ms (-5.7%)
- Pixel 9 Pro XL Method::execute: 445ms -> 411ms (-7.6%)
Differential Revision: [D97058156](https://our.internmc.facebook.com/intern/diff/D97058156/)
[ghstack-poisoned]1 parent ed57040 commit 552a31f
1 file changed
+6
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
0 commit comments