Skip to content

Reduction interface #234

Closed

Description

@vchuravy

@glwagner needs a reduction interface so we should finally add that.

cc: @jpsamaroo

Activity

  1. jpsamaroo commented on Apr 6, 2021

    @jpsamaroo
    Member

    What kinds of reduction intrinsics does CUDA support? AMDGPU has wfred, which reduces a single value across all active lanes. I figure this could be easy to support, like result = @reduce_warp op input

  2. rveltz commented on Sep 4, 2022

    @rveltz

    maybe something like in FoldsCUDA?

  3. eschnett commented on Dec 22, 2023

    @eschnett
    Contributor

    Even if there is no portable access to lower-level reduction primitives it would be good to have an example of a reduction operation (e.g. sum, maximum), probably implemented via local memory. The histogram example does that but it's more complicated than a straightforward reduction.

  4. added
    kernelsWriting and compiling kernels: kernel language, intrinsics, codegen, back-end interface.
    on Oct 19, 2026
  5. maleadt commented on Oct 19, 2026

    @maleadt
    Member

    Implemented for KA 0.10: @groupreduce and @groupscan (#830) reduce and scan over a workgroup on every backend, and KernelInterface has sub-group reductions and scans (KI.sub_group_reduce, #831), which @groupreduce uses where the backend can shuffle. See the "Reductions and scans" section of the kernel docs for an example. Device-wide reductions are left to mapreduce in GPUArrays.jl or AcceleratedKernels.jl.

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

    kernelsWriting and compiling kernels: kernel language, intrinsics, codegen, back-end interface.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions