-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tutorial fails using Metal.jl #315
Comments
More information in case relevant: Metal.versioninfo()
macOS 14.0.0, Darwin 23.0.0
Toolchain:
- Julia: 1.9.0
- LLVM: 14.0.6
Julia packages:
- Metal.jl: 0.5.1
- Metal_LLVM_Tools_jll: 0.5.1+0
1 device:
- Apple M1 (2.406 MiB allocated) |
The Apple M1 does not support Float64 values yet, which is causing some issues with type I am trying to fix it using #317. Thanks for bringing it up! |
I'm getting a different error with the previous tutorial (no Error: No solution found
│ tspan = 0.0f0
│ ts =
│ 2-element view(::Matrix{Float32}, :, 1) with eltype Float32:
│ 0.0
│ 0.0
└ @ DiffEqGPU ~/.julia/packages/DiffEqGPU/I999k/src/solve.jl:175
ERROR: Batch solve failed Code
using DiffEqGPU, OrdinaryDiffEq, StaticArrays, Metal
function lorenz(u, p, t)
σ = p[1]
ρ = p[2]
β = p[3]
du1 = σ * (u[2] - u[1])
du2 = u[1] * (ρ - u[3]) - u[2]
du3 = u[1] * u[2] - β * u[3]
return SVector{3}(du1, du2, du3)
end
u0 = @SVector [1.0f0; 0.0f0; 0.0f0]
tspan = (0.0f0, 10.0f0)
p = @SVector [10.0f0, 28.0f0, 8 / 3.0f0]
prob = ODEProblem{false}(lorenz, u0, tspan, p)
prob_func = (prob, i, repeat) -> remake(prob, p = (@SVector rand(Float32, 3)) .* p) # this fails
#prob_func = (prob, i, repeat) -> remake(prob, p = (@SVector rand(Float32, 3)) .* p .* 0.1f0) # this works
monteprob = EnsembleProblem(prob, prob_func = prob_func, safetycopy = false)
sol = solve(monteprob, GPUTsit5(), EnsembleGPUKernel(Metal.MetalBackend()), trajectories = 10_000) Complete error
Package versions
Metal.versioninfo()
|
Hi,
I am trying to run this tutorial on my laptop, which has an M1 processor. My understanding is that to do this, I should just change
CUDA
toMetal
:However, when I run the code above, the last line gives the error:
These are the package versions:
Is this the expected behavior?
The text was updated successfully, but these errors were encountered: