Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Update AMDGPU RNG #48

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "LuxDeviceUtils"
uuid = "34f89e08-e1d5-43b4-8944-0b49ac560553"
authors = ["Avik Pal <[email protected]> and contributors"]
version = "0.1.24"
version = "0.1.25"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
2 changes: 1 addition & 1 deletion ext/LuxDeviceUtilsAMDGPUExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
LuxDeviceUtils._get_device_id(dev::LuxAMDGPUDevice) = AMDGPU.device_id(dev.device)

# Default RNG
LuxDeviceUtils.default_device_rng(::LuxAMDGPUDevice) = AMDGPU.rocrand_rng()
LuxDeviceUtils.default_device_rng(::LuxAMDGPUDevice) = AMDGPU.gpuarrays_rng()

Check warning on line 46 in ext/LuxDeviceUtilsAMDGPUExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/LuxDeviceUtilsAMDGPUExt.jl#L46

Added line #L46 was not covered by tests

# Query Device from Array
function LuxDeviceUtils.get_device(x::AMDGPU.AnyROCArray)
Expand Down
2 changes: 1 addition & 1 deletion test/amdgpu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ using FillArrays, Zygote # Extensions

device = gpu_device()
aType = LuxDeviceUtils.functional(LuxAMDGPUDevice) ? ROCArray : Array
rngType = LuxDeviceUtils.functional(LuxAMDGPUDevice) ? AMDGPU.rocRAND.RNG :
rngType = LuxDeviceUtils.functional(LuxAMDGPUDevice) ? AMDGPU.GPUArrays.RNG :
Random.AbstractRNG

ps_xpu = ps |> device
Expand Down
Loading