SciML / SciML/RecursiveArrayTools.jl
FastBroadcast.jl is not using multithreading with `ArrayPartition`
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 233
- Forks
- 76
- Avg merge
- 2h 17m
- Merged PRs (30d)
- 9
Description
Things like this are not multithreaded when u is an ArrayPartition:
@.. broadcast=false thread=true u=u + x * u
ArrayPartitions use a custom BroadcastStyle. FastBroadcast.jl therefore doesn't go into the fast_materialize_threaded! branch and instead calls the generic materialize!, which is not threaded:
https://github.com/YingboMa/FastBroadcast.jl/blob/ad586d83ffcac15c92969b93dd5cf0c8fd025af9/src/FastBroadcast.jl#L305-L313
Multithreaded schemes in OrdinaryDiffEq.jl are using @.. broadcast=false thread=thread ..., and OrdinaryDiffEq.jl is using an ArrayPartition for DynamicalODEProblems. Therefore, time integration is not multithreaded (even when setting thread=True()) with a DynamicalODEProblem and a scheme that works for a general ODEProblem (including all RK methods).
Not sure in which repo this should be fixed, so I just reported it here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked FastBroadcast.jl section around lines 305-313 and the ArrayPartition broadcast style in RecursiveArrayTools.jl. Trace why the threaded fast_materialize path is skipped, then determine which repository owns the fix and verify threaded execution for a DynamicalODEProblem using the reported broadcast form.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100