Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why offload the points and weights to CPU before DT? #7

Closed
lizhiqi49 opened this issue Jul 21, 2024 · 4 comments
Closed

Why offload the points and weights to CPU before DT? #7

lizhiqi49 opened this issue Jul 21, 2024 · 4 comments

Comments

@lizhiqi49
Copy link

dmesh/diffdt/cgalwdt.py

Lines 26 to 38 in 8a76623

with th.no_grad():
t_positions, t_weights = points.positions, points.weights
if t_positions.device != th.device('cpu'):
t_positions = points.positions.cpu()
if t_weights.device != th.device('cpu'):
t_weights = points.weights.cpu()
result = _C.delaunay_triangulation(t_positions,
t_weights,
weighted,
parallelize,
p_lock_grid_size,
compute_cc)

I notice that the points and weights are offloaded to cpu before delaunay triangulation, wasn't this process executed in CUDA? And why make the differential DT under torch.no_grad() context?

@SonSang
Copy link
Owner

SonSang commented Jul 21, 2024

Hi, in the current implementation, we first run non-differentiable DT (on CPU) on the weighted point set.
Then, based on the result, we compute the existence probability of the faces. In that part, we use CUDA.
Please see our paper (Sec. 3.2, 4.1) for the details.

@lizhiqi49
Copy link
Author

Got it, thanks for your nice reply! BTW, I don't know much about the implementation of DT, and I want to know whether DT running on CPU is an large overhead for computation time compared with being executed on CUDA (if possible)?

@SonSang
Copy link
Owner

SonSang commented Jul 23, 2024

Yes, unfortunately, the DT running on CPU is our computational bottleneck when it comes to a large-scale point cloud ( > 50K). We also searched for a possible CUDA implementation for DT, and there were several papers about it, we could not find suitable one for our paper. So we assume we need a whole new different approach if we truly want to handle a very large point cloud (~= 1M).

@lizhiqi49
Copy link
Author

Thanks again for your nice reply! :)

@SonSang SonSang closed this as completed Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants