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

Non-Allocating ACE-Lux Networks #45

Open
cortner opened this issue Jun 20, 2023 · 1 comment
Open

Non-Allocating ACE-Lux Networks #45

cortner opened this issue Jun 20, 2023 · 1 comment

Comments

@cortner
Copy link
Member

cortner commented Jun 20, 2023

@CheukHinHoJerry : This is an idea how to get rid of the nasty allocation you have in sparsesymmprodand all the other layers too. Im using incorrect names here because I don't remember the correct ones, but the gist is hopefully clear:

struct P4ML_LuxLayer 
      # all the other stuff, then add the following field: 
     release_input::Bool
end

function (l::P4MLLuxLayer)(X, ps, st) 
     out = acquire!(st, ....)
     evaluate!(out, l.basis, X, ps, st.temp)
     if l.release_input
          release!(X)
     end 
    return out 
end

Basically this will enable you to release each computed basis once it is no longer needed back into the pool, and this allocation should then go away. What do you think?

@CheukHinHoJerry
Copy link
Collaborator

Thank you. I will think this through and do this together with the trainable layer interface that we mentioned.

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