-
Notifications
You must be signed in to change notification settings - Fork 23
Closed as not planned
Labels
enhancement (performance)Would reduce the time it takes to run some bit of the codeWould reduce the time it takes to run some bit of the codeenhancement: new rules required
Description
Mooncake's default broadcast(f, As...) rules are generally fast, but they can be slow when f is computationally lightweight.
This has been observed in several settings, eg, #521, #249
One might look into the possibility of importing ChainRules rules for broadcast via @from_chainrules for specific input types like Array{<:IEEEFloat}. See below for an example how this might be done
Mooncake.jl/ext/MooncakeLuxLibSLEEFPiratesExtension.jl
Lines 18 to 25 in d166bc6
| @eval @from_rrule( | |
| DefaultCtx, | |
| Tuple{ | |
| typeof(Broadcast.broadcasted), | |
| typeof($f_fast), | |
| Union{IEEEFloat,Array{<:IEEEFloat}}, | |
| }, | |
| ) |
Copilot
Metadata
Metadata
Assignees
Labels
enhancement (performance)Would reduce the time it takes to run some bit of the codeWould reduce the time it takes to run some bit of the codeenhancement: new rules required