-
Notifications
You must be signed in to change notification settings - Fork 64
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
segfault in specific formula #275
Comments
Hello @albertfgu , Here is the full code that I tried and which works : import torch
from pykeops.torch import Genred
def _broadcast_dims(*args):
out = []
for x in args:
out.append(x[:,None])
return out
def _c2r(x):
return torch.stack((torch.real(x),torch.imag(x)),dim=len(x.shape)).reshape(x.shape[:-1]+(-1,))
def log_vandermonde(v, x, L, conj=True):
expr = 'ComplexMult(v, ComplexExp(ComplexMult(x, l)))'
vandermonde_mult = Genred(
expr,
[
'v = Vj(2)',
'x = Vj(2)',
'l = Vi(2)',
],
reduction_op='Sum',
axis=1,
)
l = torch.arange(L).to(x)
v, x, l = _broadcast_dims(v, x, l)
v = _c2r(v)
x = _c2r(x)
l = _c2r(l)
r = vandermonde_mult(v, x, l, backend='GPU')
return r
L, N = 2000, 1000
v = torch.rand(N, dtype=torch.complex64)
x = 1j * torch.rand(N, dtype=torch.float32)
out = log_vandermonde(v, x, L)
print("ok")
print("shape of output : ",out.shape)
print("norm of output : ",torch.norm(out)) Also note that we have a Let me know if the code above works on your side or if there is another issue. |
N.B. I just did a commit for this issue ; in fact it is a fix for the |
I'm closing this issue, based on my answer above. Please feel free to reopen. |
I upgraded to the most recent packages (I think keopscore got an update?). One of my keops formulas works great, but the other one is segfaulting with no error message. This is the kernel
The text was updated successfully, but these errors were encountered: