Skip to content

GPUArrays rand seeding fails when container is bigger than workgroup size #643

Closed

Description

@christiangnrd

See linked comment below for context, but in short I'm getting different results than CI on the rand doctest that uses GPUArrays.default_rng(MtlArray)

I was just getting different results locally and figured if it's unstable between devices maybe better to filter it out but maybe we should look into that instead (in a future pr). Lmk if I should revert the regex filter.

Originally posted by @christiangnrd in JuliaGPU/Metal.jl#641 (comment)

Activity

  1. changed the title [-]Issues(?) with GPUArrays `rand` seeding[/-] [+]GPUArrays `rand` seeding fails when container is bigger than workgroup size[/+] on Oct 30, 2025
  2. christiangnrd commented on Oct 30, 2025

    @christiangnrd
    Author
  3. added
    arraysThe array abstraction: broadcasting, mapreduce, indexing, views, generic linear algebra.
    on Oct 19, 2026
  4. maleadt commented on Oct 19, 2026

    @maleadt
    Member

    Fixed by #707, which replaced the stateful Tausworthe generator with a counter-based Philox RNG: values only depend on the seed, counter and element index, so they no longer change with the launch configuration or the back-end. rand(GPUArrays.RNG{CuArray}(42), Float32, n) now matches the JLArray output bit-for-bit for every n.

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

    arraysThe array abstraction: broadcasting, mapreduce, indexing, views, generic linear algebra.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions