-
Notifications
You must be signed in to change notification settings - Fork 67
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
Immutable Arrays #8
Comments
I think the poor broadcasting performance likely has to do with some missed chance to perform our memory optimization in the broadcast logic somewhere (i.e., we think it is unsafe to optimize in a place where it's actually safe to do so). I will take a look into this when I get a chance, but thanks for putting this together and providing a nice, realistic benchmark for performance going forward! |
Also, minor nit, but make_immutable(x::AbstractArray) = ImmutableArray(copy(x)) |
I added it for |
Add better defaults to initialparams/states
…eckout-4 Bump actions/checkout from 3 to 4
…01-07-40-639-03174998788 CompatHelper: bump compat for ComponentArrays to 0.15, (keep existing compat)
Testing out the Immutable Arrays from JuliaLang/julia#44381 with #7
TLDR: Performance is a slight pain (seems broadcasting) right now, but it is very straightforward to support these once the functionality is available in Base
EDIT: Code updated to work for Lux 0.4.*
Trial 1: From the Usage Example
Standard Abstract Arrays
Immutable Arrays
Trial 2: Only a Dense Layer
Standard Abstract Arrays
Immutable Arrays
Seems like there is a lot of time being spent on broadcasting the bias (seems like a problem with broadcasting in general)
Trial 3: No broadcasting
Standard Abstract Arrays
Immutable Arrays
Trial 4
Standard Abstract Arrays
Immutable Arrays
cc @ChrisRackauckas @ianatol @aviatesk
The text was updated successfully, but these errors were encountered: