Hi,
In an Android program, I want to run a model optimized for Vulkan. The main issue I encounter is that my input tensor seem to exceed some limit, I seem to be unable to load a tensor bigger than {1, 4, 2048, 2048}.
The 2048 seem to be the limit maxImageDimension3D of my Vulkan device, however I cannot find hard data on the 4 channel limit.
Here’s the loading code I have
auto tensor_a = at::rand({1, channels, 2048, 2048}, at::device(at::kCPU).dtype(at::kFloat));
auto tensor_a_vulkan = tensor_a.vulkan();
If “channels” is anything higher than 4 (or the image sizes is bigger), it will result in:
terminating with uncaught exception of type c10::Error: VkResult:-2
Exception raised from buffer at <prefix>pytorch/aten/src/ATen/native/vulkan/api/Resource.cpp:479 (most recent call first):
(no backtrace available)
Aborted
There is still memory available on the device, I can safely allocate more tensors on the CPU and load them to Vulkan with no issues (as long as the individual dimensions are below the apparent limits) .
Is this a known limitation? Is there any way to work around it?
Thanks,
Julien