Skip to content
This repository was archived by the owner on Mar 18, 2023. It is now read-only.
This repository was archived by the owner on Mar 18, 2023. It is now read-only.

Possible TPU crash #36

@staticfloat

Description

@staticfloat
Base.@pure calc_rounds(L; exponent=3) = ceil(UInt32, exponent * log(L) / log(typemax(UInt32)))
function shuffle(x::XRTArray)
    rounds = calc_rounds(length(x))
    round_idx = XRTArray(rounds)
    while round_idx > XRTArray(0)
        keys = rand(XRTArray{UInt32}, length(x))
        x = sort(x, keys=keys)
        # Commenting this out crashes the TPU
        #round_idx -= XRTArray(1)
    end
    return x
end

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