Open samuele-bortolato opened 1 year ago
Actually, there was no need to compute the unique,
pts=np.array(torch.unique(quantized_points,dim=0), dtype=np.uint8)[:,None]
can be modified in
pts=np.array(quantized_points, dtype=np.uint8)[:,None]
Hi @samuele-bortolato , thanks for the useful feedback! Your issue is relevant to kaolin, but kaolin's maintainers overlap with kaolin-wisp so I just forwarded your message.
Feel free to post any other suggestions or issues on kaolin's github: https://github.com/NVIDIAGameWorks/kaolin
Thanks again for the amazing library!
I've been using it with other students for a project for my master degree. The problem is that as it's usual for students, we don't have super powerfull machines, and we had to use laptops with 2 or 4GB of VRAM.
I know these kinf of machines don't offer the best experience possible and even simple runs will take a lot of times but they should at least work, at least lowering a lot the quality.
The problem is that most of the grids in the library require octrees, and the kaolin implementation for creating the octrees is highly inefficient in terms of space.
Digging a bit deeper I think I think the cause is in _ops/conversions/mesh_to_spc/mesh_tospc.cpp from kaolin
that initializes the buffer tensors at the maximum size regardless of the size of the input and of the available size, making our low memory gpus crash OOM (it triees to initialize a few GB of memory).
In order to make it work on our laptops we made two changes in _wisp/accelstructs/octreeas.py, :
modify the make_dense function (in order to be able to create the octree at the beginning), that was calling points_to_octree without any reason since we already know the size of the octree and it's filled with 255.
modify from_quantized_points (in oder to be able to prune the structure), here we just plainly had to rewrite the function in a way that didn't crash the gpu
...
def from_quantized_points(cls, quantized_points, level) -> OctreeAS: """ Builds the acceleration structure from quantized (integer) point coordinates.