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

RuntimeError: false INTERNAL ASSERT FAILED #4

Open
csinva opened this issue May 5, 2024 · 3 comments
Open

RuntimeError: false INTERNAL ASSERT FAILED #4

csinva opened this issue May 5, 2024 · 3 comments

Comments

@csinva
Copy link

csinva commented May 5, 2024

Getting this error when running test_simple_math.py. Any idea how to resolve it?

  File "/home/chansingh/test/kan.py", line 131, in curve2coeff
    solution = torch.linalg.lstsq(
               ^^^^^^^^^^^^^^^^^^^
RuntimeError: false INTERNAL ASSERT FAILED at "../aten/src/ATen/native/BatchLinearAlgebra.cpp":1539, please report a bug to PyTorch. torch.linalg.lstsq: (Batch element 0): Argument 6 has illegal value. Most certainly there is a bug in the implementation calling the backend library.

(pytorch is up-to-date, version '2.3.0+cu121', python 3.11)

@pecanjk
Copy link

pecanjk commented May 8, 2024

Me, too. But the examples/mnist.py can work correctly.

@csinva
Copy link
Author

csinva commented May 8, 2024

Worked okay when I just lowered the learning rate / switched the optimizer...

@Blealtan
Copy link
Owner

That one happens somewhat randomly when reconstructing the splines on the new grid (performing update_grid)... Possibly some numerical failure in the Least Square optimization. I also encountered that in some cases. To workaround that, consider pre-normalize input into [-1, 1], and avoid calling update_grid.

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

3 participants