Skip to content

Commit 2416633

Browse files
committed
Update on "[ET-VK][ez] Ensure descriptor set pools don't run out of memory"
## Context While testing a toy model with a large number of operators, I ran into an issue on my local Pixel 6 Android device where the descriptor pool was running out of memory. This changeset implements a simple fix to ensure that descriptor pools do not run into this issue. A longer term solution is to implement layout specific descriptor pools, but that is much more technically complex so go with this for now. ## Problem Details #2285 made it so that `ComputeGraph` could tally up the total number of descriptors needed and size the descriptor pools appropriately, but it seems that this is not compatible with certain Vulkan drivers. In the toy model, 1000 binary operators were added. Counting the descriptors required for the graph provides descriptor counts of ``` descriptorPoolMaxSets: 1255 descriptorUniformBufferCount: 5013 descriptorStorageBufferCount: 4 descriptorCombinedSamplerCount: 2504 descriptorStorageImageCount: 1254 ``` Which appears to be correct, however it appears that the descriptor pool runs out of memory due to an insufficient number of `descriptorStorageBufferCount`. The `descriptorStorageBufferCount` needs to be set at a surprisingly high number (approx ~1000) before the descriptor pool does not run out of memory. I'm not sure exactly what causes this behaviour, but it could be due to the implementation details of the driver. ## Solution Ensure that all descriptor counts are at greater than or equal to the maximum number of descriptor sets seems to work. Implement this as a temporary solution. Differential Revision: [D54853788](https://our.internmc.facebook.com/intern/diff/D54853788/) [ghstack-poisoned]
1 parent 63aecc2 commit 2416633

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

backends/vulkan/test/vulkan_compute_api_test.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,8 +700,7 @@ TEST(VulkanComputeGraphTest, test_large_graph) {
700700

701701
int n = 100;
702702

703-
for (int i=0; i<n;i ++ ){
704-
703+
for (int i = 0; i < n; i++) {
705704
addFn(graph, {c, b.value, kDummyValueRef, a.value});
706705

707706
addFn(graph, {a.value, b.value, kDummyValueRef, c});

0 commit comments

Comments
 (0)