MuladdMacro
This package contains a macro for converting expressions to use muladd calls and fused-multiply-add (FMA) operations for high-performance in the SciML scientific machine learning ecosystem
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 15 committers (6.7%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.3%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
This package contains a macro for converting expressions to use muladd calls and fused-multiply-add (FMA) operations for high-performance in the SciML scientific machine learning ecosystem
Basic Info
- Host: GitHub
- Owner: SciML
- License: other
- Language: Julia
- Default Branch: master
- Homepage: https://docs.sciml.ai/MuladdMacro/stable/
- Size: 316 KB
Statistics
- Stars: 44
- Watchers: 7
- Forks: 8
- Open Issues: 1
- Releases: 8
Topics
Metadata Files
README.md
MuladdMacro.jl
This package provides the @muladd macro. It automatically converts expressions
with multiplications and additions or subtractions to calls with muladd which then fuse via
FMA when it would increase the performance of the code. The @muladd macro
can be placed on code blocks and it will automatically find the appropriate
expressions and nest muladd expressions when necessary. In mixed expressions summands without multiplication
will be grouped together and evaluated first but otherwise the order of evaluation of multiplications and additions is not changed.
Tutorials and Documentation
For information on using the package, see the stable documentation. Use the in-development documentation for the version of the documentation, which contains the unreleased features.
Examples
```julia-repl julia> using MuladdMacro
julia> @macroexpand(@muladd k3 = f(t + c3 * dt, @. uprev + dt * (a031 * k1 + a032 * k2))) :(k3 = f((muladd)(c3, dt, t), (muladd).(dt, (muladd).(a032, k2, (*).(a031, k1)), uprev)))
julia> @macroexpand(@muladd integrator.EEst = integrator.opts.internalnorm((update - dt * (bhat1 * k1 + bhat4 * k4 + bhat5 * k5 + bhat6 * k6 + bhat7 * k7 + bhat10 * k10)) ./ @. (integrator.opts.abstol + max(abs(uprev), abs(u)) * integrator.opts.reltol))) :(integrator.EEst = integrator.opts.internalnorm((muladd)(-dt, (muladd)(bhat10, k10, (muladd)(bhat7, k7, (muladd)(bhat6, k6, (muladd)(bhat5, k5, (muladd)(bhat4, k4, bhat1 * k1))))), update) ./ (muladd).(max.(abs.(uprev), abs.(u)), integrator.opts.reltol, integrator.opts.abstol))) ```
Broadcasting
A muladd call will be broadcasted if both the * and the + or - are broadcasted.
If either one is not broadcasted, then the expression will be converted to a
non-dotted muladd.
Limitations
Currently, @muladd handles only explicit calls of + and *. In particular, assignments
using += or literal power such as ^2 are not supported. Thus, you need to rewrite them, e.g.
```julia-repl julia> using MuladdMacro
julia> a = 1.0; b = 2.0; c = 3.0;
julia> @macroexpand @muladd a += b * c # does not work :(a += b * c)
julia> @macroexpand @muladd a = a + b * c # good alternative :(a = (muladd)(b, c, a))
julia> @macroexpand @muladd a + b^2 # does not work :(a + b ^ 2)
julia> @macroexpand @muladd a + b * b # good alternative :((muladd)(b, b, a)) ```
Credit
Most of the credit goes to @fcard and @devmotion for building the first version and greatly refining the macro. These contributions are not directly shown as this was developed in Gitter chats and in the DiffEqBase.jl repository, but these two individuals did almost all of the work.
Owner
- Name: SciML Open Source Scientific Machine Learning
- Login: SciML
- Kind: organization
- Email: contact@chrisrackauckas.com
- Website: https://sciml.ai
- Twitter: SciML_Org
- Repositories: 170
- Profile: https://github.com/SciML
Open source software for scientific machine learning
Citation (CITATION.bib)
@article{DifferentialEquations.jl-2017,
author = {Rackauckas, Christopher and Nie, Qing},
doi = {10.5334/jors.151},
journal = {The Journal of Open Research Software},
keywords = {Applied Mathematics},
note = {Exported from https://app.dimensions.ai on 2019/05/05},
number = {1},
pages = {},
title = {DifferentialEquations.jl – A Performant and Feature-Rich Ecosystem for Solving Differential Equations in Julia},
url = {https://app.dimensions.ai/details/publication/pub.1085583166 and http://openresearchsoftware.metajnl.com/articles/10.5334/jors.151/galley/245/download/},
volume = {5},
year = {2017}
}
GitHub Events
Total
- Issues event: 1
- Delete event: 4
- Issue comment event: 1
- Push event: 19
- Pull request review event: 5
- Pull request review comment event: 7
- Pull request event: 11
- Create event: 4
Last Year
- Issues event: 1
- Delete event: 4
- Issue comment event: 1
- Push event: 19
- Pull request review event: 5
- Pull request review comment event: 7
- Pull request event: 11
- Create event: 4
Committers
Last synced: 11 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Christopher Rackauckas | a****s@c****m | 26 |
| David Widmann | d****n | 18 |
| Arno Strouwen | a****n@t****e | 12 |
| dependabot[bot] | 4****] | 8 |
| Hendrik Ranocha | r****a | 4 |
| Kevin | k****s@g****m | 3 |
| Anant Thazhemadam | 4****m | 2 |
| Chris de Graaf | me@c****v | 2 |
| Krishna Bhogaonker | c****q@g****m | 2 |
| github-actions[bot] | 4****] | 2 |
| Anshul Singhvi | a****7@s****u | 1 |
| Benoît Legat | b****t@g****m | 1 |
| Julia TagBot | 5****t | 1 |
| Lyndon White | l****e@i****k | 1 |
| Yingbo Ma | m****5@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 7
- Total pull requests: 56
- Average time to close issues: about 2 months
- Average time to close pull requests: 6 days
- Total issue authors: 6
- Total pull request authors: 15
- Average comments per issue: 4.14
- Average comments per pull request: 1.38
- Merged pull requests: 49
- Bot issues: 0
- Bot pull requests: 11
Past Year
- Issues: 0
- Pull requests: 3
- Average time to close issues: N/A
- Average time to close pull requests: about 1 hour
- Issue authors: 0
- Pull request authors: 3
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 1
Top Authors
Issue Authors
- ChrisRackauckas (2)
- ikirill (1)
- devmotion (1)
- jondeuce (1)
- ArnoStrouwen (1)
- JuliaTagBot (1)
- JeffBezanson (1)
Pull Request Authors
- ArnoStrouwen (17)
- dependabot[bot] (15)
- devmotion (12)
- ranocha (5)
- ChrisRackauckas (4)
- thazhemadam (4)
- YingboMa (3)
- github-actions[bot] (2)
- 00krishna (2)
- blegat (2)
- christopher-dG (2)
- ksmcreynolds (1)
- oxinabox (1)
- asinghvi17 (1)
- JuliaTagBot (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- julia 6,093 total
- Total dependent packages: 23
- Total dependent repositories: 0
- Total versions: 6
juliahub.com: MuladdMacro
This package contains a macro for converting expressions to use muladd calls and fused-multiply-add (FMA) operations for high-performance in the SciML scientific machine learning ecosystem
- Homepage: https://docs.sciml.ai/MuladdMacro/stable/
- Documentation: https://docs.juliahub.com/General/MuladdMacro/stable/
- License: MIT
-
Latest release: 0.2.4
published over 3 years ago
Rankings
Dependencies
- actions/checkout v4 composite
- codecov/codecov-action v3 composite
- julia-actions/cache v1 composite
- julia-actions/julia-buildpkg v1 composite
- julia-actions/julia-processcoverage v1 composite
- julia-actions/julia-runtest v1 composite
- julia-actions/setup-julia v1 composite
- actions/checkout v4 composite
- codecov/codecov-action v3 composite
- julia-actions/julia-processcoverage v1 composite
- julia-actions/setup-julia latest composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- julia-actions/setup-julia v1 composite
- actions/checkout v4 composite
- julia-actions/julia-buildpkg v1 composite
- julia-actions/julia-invalidations v1 composite
- julia-actions/setup-julia v1 composite
- JuliaRegistries/TagBot v1 composite
- actions/checkout v4 composite
- cjdoris/julia-downgrade-compat-action v1 composite
- julia-actions/julia-buildpkg v1 composite
- julia-actions/julia-runtest v1 composite
- julia-actions/setup-julia v1 composite
- actions/checkout v4 composite
- crate-ci/typos v1.16.23 composite