JuliaGPU / JuliaGPU/KernelAbstractions.jl

WaterLily performance regression on CPU multi-threading backend for Julia 1.13.0

Open
#696 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
523
Forks
88
Avg merge
1d 11h
Merged PRs (30d)
25

Description

The following tests show the performance of WaterLily on Julia 1.11.5 vs 1.13.0-rc1 under different backends. There seems to be a significant performance regression on the KA CPU multi-threading backend, CPUx04. The CPUx01 backend uses SIMD instead of KA and is used for reference. A regression was also observed on Julia 1.12.0, https://github.com/JuliaGPU/KernelAbstractions.jl/issues/644.

Benchmark environment: tgv sim_step! (max_steps=25, samples=5)
▶ log2p = 6
┌────────────┬───────────┬────────────┬─────────────┬────────┬─────────┬─────────┬─────────┬──────────────────┬──────────┐
│    Backend │ WaterLily │      Julia │ Allocations │ GC [%] │ Min [s] │ Med [s] │ Max [s] │ Cost [ns/DOF/dt] │ Speed-up │
├────────────┼───────────┼────────────┼─────────────┼────────┼─────────┼─────────┼─────────┼──────────────────┼──────────┤
│     CPUx01 │    v1.6.1 │     1.11.5 │        1056 │   0.00 │    0.99 │    1.08 │    1.18 │           151.63 │     1.00 │
│     CPUx01 │    v1.6.1 │ 1.13.0-rc1 │        1055 │   0.00 │    1.04 │    1.15 │    1.21 │           158.71 │     0.96 │
│     CPUx04 │    v1.6.1 │     1.11.5 │      473231 │   0.00 │    0.66 │    0.70 │    0.71 │           101.06 │     1.50 │
│     CPUx04 │    v1.6.1 │ 1.13.0-rc1 │      473030 │   0.00 │    1.00 │    1.17 │    1.29 │           152.73 │     0.99 │
│ GPU-NVIDIA │    v1.6.1 │     1.11.5 │      519531 │   0.00 │    0.09 │    0.10 │    0.11 │            14.41 │    10.52 │
│ GPU-NVIDIA │    v1.6.1 │ 1.13.0-rc1 │      345454 │   0.00 │    0.10 │    0.10 │    0.11 │            15.59 │     9.73 │
└────────────┴───────────┴────────────┴─────────────┴────────┴─────────┴─────────┴─────────┴──────────────────┴──────────┘
▶ log2p = 7
┌────────────┬───────────┬────────────┬─────────────┬────────┬─────────┬─────────┬─────────┬──────────────────┬──────────┐
│    Backend │ WaterLily │      Julia │ Allocations │ GC [%] │ Min [s] │ Med [s] │ Max [s] │ Cost [ns/DOF/dt] │ Speed-up │
├────────────┼───────────┼────────────┼─────────────┼────────┼─────────┼─────────┼─────────┼──────────────────┼──────────┤
│     CPUx01 │    v1.6.1 │     1.11.5 │        1155 │   0.00 │    7.03 │    7.08 │    7.14 │           134.01 │     1.00 │
│     CPUx01 │    v1.6.1 │ 1.13.0-rc1 │        1155 │   0.00 │    7.44 │    7.47 │    7.58 │           141.83 │     0.94 │
│     CPUx04 │    v1.6.1 │     1.11.5 │      508180 │   0.00 │    4.25 │    4.63 │    5.35 │            81.14 │     1.65 │
│     CPUx04 │    v1.6.1 │ 1.13.0-rc1 │      507980 │   0.00 │    6.28 │    6.76 │    7.47 │           119.69 │     1.12 │
│ GPU-NVIDIA │    v1.6.1 │     1.11.5 │      560755 │   0.00 │    0.66 │    0.66 │    0.67 │            12.59 │    10.64 │
│ GPU-NVIDIA │    v1.6.1 │ 1.13.0-rc1 │      378728 │   0.00 │    0.71 │    0.72 │    0.72 │            13.49 │     9.94 │
└────────────┴───────────┴────────────┴─────────────┴────────┴─────────┴─────────┴─────────┴──────────────────┴──────────┘
Benchmark environment: sphere
▶ log2p = 3
┌────────────┬───────────┬────────────┬─────────────┬────────┬─────────┬─────────┬─────────┬──────────────────┬──────────┐
│    Backend │ WaterLily │      Julia │ Allocations │ GC [%] │ Min [s] │ Med [s] │ Max [s] │ Cost [ns/DOF/dt] │ Speed-up │
├────────────┼───────────┼────────────┼─────────────┼────────┼─────────┼─────────┼─────────┼──────────────────┼──────────┤
│     CPUx01 │    v1.6.1 │     1.11.5 │         955 │   0.00 │    1.01 │    1.06 │    1.18 │           137.47 │     1.00 │
│     CPUx01 │    v1.6.1 │ 1.13.0-rc1 │         955 │   0.00 │    1.06 │    1.08 │    1.21 │           143.59 │     0.96 │
│     CPUx04 │    v1.6.1 │     1.11.5 │      437230 │   0.00 │    0.60 │    0.61 │    0.62 │            81.01 │     1.70 │
│     CPUx04 │    v1.6.1 │ 1.13.0-rc1 │      437030 │   0.00 │    1.01 │    1.11 │    1.16 │           137.22 │     1.00 │
│ GPU-NVIDIA │    v1.6.1 │     1.11.5 │      480879 │   0.00 │    0.09 │    0.09 │    0.09 │            11.97 │    11.48 │
│ GPU-NVIDIA │    v1.6.1 │ 1.13.0-rc1 │      327128 │   0.00 │    0.09 │    0.10 │    0.11 │            12.84 │    10.71 │
└────────────┴───────────┴────────────┴─────────────┴────────┴─────────┴─────────┴─────────┴──────────────────┴──────────┘
▶ log2p = 4
┌────────────┬───────────┬────────────┬─────────────┬────────┬─────────┬─────────┬─────────┬──────────────────┬──────────┐
│    Backend │ WaterLily │      Julia │ Allocations │ GC [%] │ Min [s] │ Med [s] │ Max [s] │ Cost [ns/DOF/dt] │ Speed-up │
├────────────┼───────────┼────────────┼─────────────┼────────┼─────────┼─────────┼─────────┼──────────────────┼──────────┤
│     CPUx01 │    v1.6.1 │     1.11.5 │        1055 │   0.00 │    9.65 │    9.80 │    9.88 │           163.55 │     1.00 │
│     CPUx01 │    v1.6.1 │ 1.13.0-rc1 │        1055 │   0.00 │    9.99 │   10.08 │   10.18 │           169.30 │     0.97 │
│     CPUx04 │    v1.6.1 │     1.11.5 │      472180 │   0.00 │    4.28 │    4.38 │    4.39 │            72.60 │     2.25 │
│     CPUx04 │    v1.6.1 │ 1.13.0-rc1 │      471980 │   0.00 │    5.81 │    7.59 │    8.79 │            98.43 │     1.66 │
│ GPU-NVIDIA │    v1.6.1 │     1.11.5 │      522130 │   0.00 │    0.70 │    0.71 │    0.71 │            11.89 │    13.76 │
│ GPU-NVIDIA │    v1.6.1 │ 1.13.0-rc1 │      365427 │   0.00 │    0.76 │    0.77 │    0.79 │            12.90 │    12.68 │
└────────────┴───────────┴────────────┴─────────────┴────────┴─────────┴─────────┴─────────┴──────────────────┴──────────┘
Benchmark environment: jelly
▶ log2p = 5
┌────────────┬───────────┬────────────┬─────────────┬────────┬─────────┬─────────┬─────────┬──────────────────┬──────────┐
│    Backend │ WaterLily │      Julia │ Allocations │ GC [%] │ Min [s] │ Med [s] │ Max [s] │ Cost [ns/DOF/dt] │ Speed-up │
├────────────┼───────────┼────────────┼─────────────┼────────┼─────────┼─────────┼─────────┼──────────────────┼──────────┤
│     CPUx01 │    v1.6.1 │     1.11.5 │        1390 │   0.00 │    0.87 │    0.89 │    0.92 │           264.49 │     1.00 │
│     CPUx01 │    v1.6.1 │ 1.13.0-rc1 │        1390 │   0.00 │    0.92 │    0.93 │    0.97 │           279.29 │     0.95 │
│     CPUx04 │    v1.6.1 │     1.11.5 │     1296258 │   0.00 │    0.70 │    0.73 │    0.74 │           214.50 │     1.23 │
│     CPUx04 │    v1.6.1 │ 1.13.0-rc1 │     1296258 │   0.00 │    1.04 │    1.23 │    1.66 │           316.02 │     0.84 │
│ GPU-NVIDIA │    v1.6.1 │     1.11.5 │      795072 │   0.00 │    0.11 │    0.11 │    0.13 │            32.80 │     8.06 │
│ GPU-NVIDIA │    v1.6.1 │ 1.13.0-rc1 │      531130 │   0.00 │    0.12 │    0.14 │    0.15 │            35.45 │     7.46 │
└────────────┴───────────┴────────────┴─────────────┴────────┴─────────┴─────────┴─────────┴──────────────────┴──────────┘
▶ log2p = 6
┌────────────┬───────────┬────────────┬─────────────┬────────┬─────────┬─────────┬─────────┬──────────────────┬──────────┐
│    Backend │ WaterLily │      Julia │ Allocations │ GC [%] │ Min [s] │ Med [s] │ Max [s] │ Cost [ns/DOF/dt] │ Speed-up │
├────────────┼───────────┼────────────┼─────────────┼────────┼─────────┼─────────┼─────────┼──────────────────┼──────────┤
│     CPUx01 │    v1.6.1 │     1.11.5 │        1852 │   0.00 │    6.42 │    6.68 │    6.79 │           245.02 │     1.00 │
│     CPUx01 │    v1.6.1 │ 1.13.0-rc1 │        1852 │   0.00 │    6.68 │    6.88 │    7.13 │           254.88 │     0.96 │
│     CPUx04 │    v1.6.1 │     1.11.5 │     3027277 │   0.00 │    4.02 │    4.28 │    4.63 │           153.52 │     1.60 │
│     CPUx04 │    v1.6.1 │ 1.13.0-rc1 │     3027277 │   0.00 │    5.96 │    6.36 │    6.88 │           227.45 │     1.08 │
│ GPU-NVIDIA │    v1.6.1 │     1.11.5 │     1011053 │   0.00 │    0.47 │    0.50 │    0.51 │            18.08 │    13.55 │
│ GPU-NVIDIA │    v1.6.1 │ 1.13.0-rc1 │      675930 │   0.00 │    0.53 │    0.54 │    0.55 │            20.26 │    12.09 │
└────────────┴───────────┴────────────┴─────────────┴────────┴─────────┴─────────┴─────────┴──────────────────┴──────────┘

Contributor guide

No contributing guide indexed for this repository

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 reproducing the benchmark environments and compare Julia 1.11.5 with 1.13.0-rc1, focusing on the CPUx04 KernelAbstractions backend versus CPUx01. Investigate the CPU multithreading path and the related KernelAbstractions.jl issue 644. Done means identifying the regression and restoring CPUx04 performance without regressing the other backends.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.