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

Always killed #1

Open
HelloWorldLTY opened this issue May 3, 2024 · 2 comments
Open

Always killed #1

HelloWorldLTY opened this issue May 3, 2024 · 2 comments

Comments

@HelloWorldLTY
Copy link

Hi, thanks for your great work. I wonder if it is possible to provide some guidance about memory trade-off setting. I intend to allcoate a KAN with 3072 as input dimension and 2000 as output dimension. I always get killed. Normal MLP does not meet such error. Thanks a lot

@unrealwill
Copy link
Collaborator

When written naively, this layer consume a lot of memory.
If you use einsum as explained in code comment, it should use less memory.
Fusing with KeOps lazy tensor, is an alternative left to the reader.

The optimal memory usage is zero extra memory beyond the parameters (coeff size = 2inputdimoutputdim*gridsize) , inputs and outputs, which can be obtained by manually fusing :

https://github.com/GistNoesis/FusedFourierKAN

The code is not yet optimized, and painful to install, so performance may not be as fast as some code that use more memory.

Some other project https://github.com/Blealtan/efficient-kan maybe more user friendly with respect to memory.

@HelloWorldLTY
Copy link
Author

Thanks a lot. I will try other versions.

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