private-pgm icon indicating copy to clipboard operation
private-pgm copied to clipboard

LinearMeasurement slow on GPU

Open cynddl opened this issue 8 months ago • 1 comments

Instantiating a LinearMeasurement object appears to be very slow on GPU:

https://github.com/ryan112358/private-pgm/blob/57554e604733a52f6dd217bd67feef0aa7a7435b/src/mbi/marginal_loss.py#L74-L80

I tried removing the converter and the code seems to run fine, and actually faster. My guess is that many calls to send data in advance to the GPU memory are not efficient at all.

cynddl avatar Mar 29 '25 10:03 cynddl

Interesting, can you send a minimum example that demonstrates this behavior? It seems surprising that this would be the bottleneck compared to fitting the model or other parts of the code, but maybe depends on your use case

ryan112358 avatar Apr 14 '25 18:04 ryan112358