SciML / SciML/RecursiveArrayTools.jl

FastBroadcast.jl is not using multithreading with `ArrayPartition`

Open
#422 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.