Skip to content

WaterLily performance regression on CPU multi-threading backend for Julia 1.12.0 #644

Closed as duplicate

Description

@b-fg

Here are some WaterLily benchmarks with Float32 comparing Julia 1.11.5 with 1.12.0. The KA CPU multi-threading backend shows performance regression on Julia 1.12.0, specially on CPUx04 where allocations are increasing significantly.
To run your own benchmarks, please use WaterLily-Benchmarks and

sh benchmark.sh -v "1.11.5 release" -w "master" -t "1 2 4" -b "Array CuArray" -c "tgv jelly" -p "6,7 5,6" -s "100 100" -ft "Float32 Float32"
julia --project compare.jl

(Note that env var $WATERLILY_DIR needs to be set to your local WaterLily directory, or alternatively pass -wd "my/waterlily/dir" into benchmarh.sh).

--

Benchmark environment: tgv sim_step! (max_steps=100)
▶ log2p = 6
┌────────────┬───────────┬────────┬───────────┬─────────────┬────────┬──────────┬──────────────────┬──────────┐
│    Backend │ WaterLily │  Julia │ Precision │ Allocations │ GC [%] │ Time [s] │ Cost [ns/DOF/dt] │ Speed-up │
├────────────┼───────────┼────────┼───────────┼─────────────┼────────┼──────────┼──────────────────┼──────────┤
│     CPUx01 │    master │ 1.11.5 │   Float32 │        1807 │   0.00 │     4.16 │           158.85 │     1.00 │
│     CPUx01 │    master │ 1.12.0 │   Float32 │        1807 │   0.00 │     4.28 │           163.16 │     0.97 │
│     CPUx02 │    master │ 1.11.5 │   Float32 │     1687271 │   0.00 │     4.82 │           183.72 │     0.86 │
│     CPUx02 │    master │ 1.12.0 │   Float32 │     1651033 │   0.00 │     5.55 │           211.89 │     0.75 │
│     CPUx04 │    master │ 1.11.5 │   Float32 │     2334995 │   0.00 │     2.86 │           109.25 │     1.45 │
│     CPUx04 │    master │ 1.12.0 │   Float32 │   193455597 │   9.58 │     4.47 │           170.65 │     0.93 │
│ GPU-NVIDIA │    master │ 1.11.5 │   Float32 │     3041056 │   0.00 │     0.60 │            22.73 │     6.99 │
│ GPU-NVIDIA │    master │ 1.12.0 │   Float32 │     2208405 │   0.00 │     0.59 │            22.35 │     7.11 │
└────────────┴───────────┴────────┴───────────┴─────────────┴────────┴──────────┴──────────────────┴──────────┘
▶ log2p = 7
┌────────────┬───────────┬────────┬───────────┬─────────────┬────────┬──────────┬──────────────────┬──────────┐
│    Backend │ WaterLily │  Julia │ Precision │ Allocations │ GC [%] │ Time [s] │ Cost [ns/DOF/dt] │ Speed-up │
├────────────┼───────────┼────────┼───────────┼─────────────┼────────┼──────────┼──────────────────┼──────────┤
│     CPUx01 │    master │ 1.11.5 │   Float32 │        1807 │   0.00 │    25.66 │           122.35 │     1.00 │
│     CPUx01 │    master │ 1.12.0 │   Float32 │        1807 │   0.00 │    26.23 │           125.08 │     0.98 │
│     CPUx02 │    master │ 1.11.5 │   Float32 │     1571048 │   0.00 │    29.16 │           139.06 │     0.88 │
│     CPUx02 │    master │ 1.12.0 │   Float32 │     1537319 │   0.00 │    31.40 │           149.75 │     0.82 │
│     CPUx04 │    master │ 1.11.5 │   Float32 │     2175214 │   0.00 │    17.07 │            81.41 │     1.50 │
│     CPUx04 │    master │ 1.12.0 │   Float32 │   951576349 │   9.22 │    24.21 │           115.46 │     1.06 │
│ GPU-NVIDIA │    master │ 1.11.5 │   Float32 │     2784710 │   0.00 │     3.03 │            14.44 │     8.47 │
│ GPU-NVIDIA │    master │ 1.12.0 │   Float32 │     2329316 │   0.00 │     3.12 │            14.87 │     8.23 │
└────────────┴───────────┴────────┴───────────┴─────────────┴────────┴──────────┴──────────────────┴──────────┘
Benchmark environment: jelly sim_step! (max_steps=100)
▶ log2p = 5
┌────────────┬───────────┬────────┬───────────┬─────────────┬────────┬──────────┬──────────────────┬──────────┐
│    Backend │ WaterLily │  Julia │ Precision │ Allocations │ GC [%] │ Time [s] │ Cost [ns/DOF/dt] │ Speed-up │
├────────────┼───────────┼────────┼───────────┼─────────────┼────────┼──────────┼──────────────────┼──────────┤
│     CPUx01 │    master │ 1.11.5 │   Float32 │        7107 │   0.00 │     3.49 │           266.22 │     1.00 │
│     CPUx01 │    master │ 1.12.0 │   Float32 │        6307 │   0.00 │     3.54 │           269.76 │     0.99 │
│     CPUx02 │    master │ 1.11.5 │   Float32 │     3244853 │   0.00 │     5.30 │           404.21 │     0.66 │
│     CPUx02 │    master │ 1.12.0 │   Float32 │     3174214 │   0.00 │     6.16 │           470.05 │     0.57 │
│     CPUx04 │    master │ 1.11.5 │   Float32 │     4491947 │   0.67 │     3.37 │           257.31 │     1.03 │
│     CPUx04 │    master │ 1.12.0 │   Float32 │   299427100 │  10.59 │     5.44 │           414.85 │     0.64 │
│ GPU-NVIDIA │    master │ 1.11.5 │   Float32 │     5805841 │   1.49 │     0.98 │            74.80 │     3.56 │
│ GPU-NVIDIA │    master │ 1.12.0 │   Float32 │     4179289 │   0.00 │     0.89 │            68.16 │     3.91 │
└────────────┴───────────┴────────┴───────────┴─────────────┴────────┴──────────┴──────────────────┴──────────┘
▶ log2p = 6
┌────────────┬───────────┬────────┬───────────┬─────────────┬────────┬──────────┬──────────────────┬──────────┐
│    Backend │ WaterLily │  Julia │ Precision │ Allocations │ GC [%] │ Time [s] │ Cost [ns/DOF/dt] │ Speed-up │
├────────────┼───────────┼────────┼───────────┼─────────────┼────────┼──────────┼──────────────────┼──────────┤
│     CPUx01 │    master │ 1.11.5 │   Float32 │        8307 │   0.00 │    25.63 │           244.38 │     1.00 │
│     CPUx01 │    master │ 1.12.0 │   Float32 │        7307 │   0.00 │    26.46 │           252.35 │     0.97 │
│     CPUx02 │    master │ 1.11.5 │   Float32 │     4229004 │   0.00 │    28.61 │           272.88 │     0.90 │
│     CPUx02 │    master │ 1.12.0 │   Float32 │     4136532 │   0.00 │    30.73 │           293.07 │     0.83 │
│     CPUx04 │    master │ 1.11.5 │   Float32 │     5860776 │   0.17 │    17.27 │           164.69 │     1.48 │
│     CPUx04 │    master │ 1.12.0 │   Float32 │  1592091668 │  10.72 │    26.24 │           250.23 │     0.98 │
│ GPU-NVIDIA │    master │ 1.11.5 │   Float32 │     7780323 │   0.48 │     3.26 │            31.14 │     7.85 │
│ GPU-NVIDIA │    master │ 1.12.0 │   Float32 │     6813568 │   0.51 │     3.24 │            30.92 │     7.90 │
└────────────┴───────────┴────────┴───────────┴─────────────┴────────┴──────────┴──────────────────┴──────────┘

Activity

  1. b-fg commented on Oct 14, 2025

    @b-fg
    ContributorAuthor
  2. added
    runtimeHost runtime: devices, queues/streams, synchronization, memory management, multi-device, profiling.
    regressionSomething that used to work, doesn't anymore.
    on Oct 19, 2026
  3. added theissue type on Oct 19, 2026
  4. maleadt commented on Oct 19, 2026

    @maleadt
    Member

    The allocation blow-up on 1.12 no longer reproduces: with KernelAbstractions 0.9.45, WaterLily's tgv 2^6 at 4 threads allocates as much on Julia 1.12.7 as on 1.11.9 (about 240k allocations per 25 steps). The remaining slowdown on newer Julia versions is tracked in #696.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceRuntime performance.regressionSomething that used to work, doesn't anymore.runtimeHost runtime: devices, queues/streams, synchronization, memory management, multi-device, profiling.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions