Skip to content

Auto-tuning Julia kernels - #397

Open
fjwillemsen wants to merge 115 commits into
masterfrom
julia
Open

Auto-tuning Julia kernels#397
fjwillemsen wants to merge 115 commits into
masterfrom
julia

Conversation

@fjwillemsen

Copy link
Copy Markdown
Member

Motivation

With Julia's rapid adoption in high-performance and GPU computing, it is an increasingly relevant auto-tuning target.
This PR introduces native Julia GPU kernel auto-tuning support to Kernel Tuner. It allows Julia developers to leverage Kernel Tuner’s mature tuning strategies and options without reinventing the wheel.
In addition, it opens up the Julia ecosystem to any KernelTuner developer, which can be convenient due to the KernelAbstractions programming model that is able to execute abstract kernels on CUDA, AMD, oneAPI, Metal, and CPU devices.

Implementation

By implementing a new Julia backend that leverages JuliaCall, we can now compile, launch, and observe Julia GPU kernels directly from Python. This functionality is fundamental for the Julia package KernelTuner.jl, which allows interaction with Kernel Tuner fully from Julia.
Key changes:

  • New Julia Backend (JuliaFunctions): Implements a GPUBackend subclass that interfaces with Julia’s GPU ecosystem via JuliaCall. Supports automatic detection and routing to CUDA.jl, ROCBackend, oneAPI, and Metal.
  • Interface & Type Handling (interface.py): Safe conversion from Julia-specific data structures to Python-compatible types. tune_params are explicitly converted to ordered lists of tuples to preserve parameter order, and Julia vectors are mapped to Python lists via util.possible_julia_vector_to_list().
  • Immutable Kernel Representation: Introduced a @dataclass JuliaKernel to enable caching and parallel tuning execution.
  • Observer: Implemented JuliaRuntimeObserver for accurate backend-specific performance metrics within the Julia process.
  • Testing: Added various tests for the new Julia functionality. This PR has been tested; all existing and added tests pass on both CI and GPU-environment execution.

For further details on the usage, implementation and testing from the Julia side, see KernelTuner.jl.

Known Limitations & Future Work

  • Cross-language tuning (calling from Julia but targeting non-Julia backends) is marked as a TODO and requires additional work if deemed necessary.
  • Parallel tuning compatibility should be tested more extensively, in particular as a default stateful observer is used.

@sonarqubecloud

sonarqubecloud Bot commented Aug 8, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@fjwillemsen
fjwillemsen requested a lite review from Copilot and removed request for Copilot August 8, 2026 09:34
@fjwillemsen fjwillemsen changed the title Julia Auto-tuning Julia kernels Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant