Skip to content

Random Number Generation #189

Closed
Closed

Description

@AntonOresten

There are many uses for RNG, but it is also necessary for some stochastic narrow precision (#108) tricks. See e.g. https://www.radicalnumerics.ai/blog/nvfp4-part1 and https://arxiv.org/pdf/2601.22813.

Based on NVIDIA/cutile-python#17, it seems it might get support at the Tile IR level.

Activity

  1. maleadt commented on Apr 24, 2026

    @maleadt
    Member

    You mean kernel-side rand() calls?

  2. AntonOresten commented on Apr 24, 2026

    @AntonOresten
    CollaboratorAuthor

    Yeah, I suppose that'd be the API. Then presumably the Tile IR instrinsics would take UInt RNG states.

  3. maleadt commented on Apr 24, 2026

    @maleadt
    Member

    I wonder if we couldn't already do a counter-based RNG, just like we do in CUDA.jl, but then with explicitly-managed state instead of the hackery we do over there (injecting at kernel launch, storing in shared memory, etc). I'll throw a robot at it.

  4. AntonOresten commented on Apr 24, 2026

    @AntonOresten
    CollaboratorAuthor

    Not sure I understand what you mean by explicitly managed, and how it'd get incremented. Interesting though. Worth a stab!

  5. maleadt commented on Apr 27, 2026

    @maleadt
    Member

    Let me know how the RNG works! It seems to perform really well, if anything.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions