Skip to content
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

CUDA.math_mode!(...; precision) option not working #1392

Closed
carstenbauer opened this issue Feb 22, 2022 · 0 comments · Fixed by #1394
Closed

CUDA.math_mode!(...; precision) option not working #1392

carstenbauer opened this issue Feb 22, 2022 · 0 comments · Fixed by #1394
Labels
bug Something isn't working

Comments

@carstenbauer
Copy link
Member

The precision option of CUDA.math_mode! isn't working.

julia> CUDA.math_mode!(CUDA.FAST_MATH; precision=:Float16)
ERROR: MethodError: Cannot `convert` an object of type typeof(CUDA.math_precision) to an object of type Symbol
Closest candidates are:
  convert(::Type{T}, ::T) where T at /scratch/pc2-mitarbeiter/bauerc/.julia/juliaup/julia-1.7.2+0~x64/share/julia/base/essentials.jl:218
  Symbol(::Any...) at /scratch/pc2-mitarbeiter/bauerc/.julia/juliaup/julia-1.7.2+0~x64/share/julia/base/strings/basic.jl:229
Stacktrace:
 [1] setproperty!(x::CUDA.TaskLocalState, f::Symbol, v::Function)
   @ Base ./Base.jl:43
 [2] math_mode!(mode::CUDA.MathMode; precision::Symbol)
   @ CUDA /scratch/pc2-mitarbeiter/bauerc/.julia/packages/CUDA/t62lT/lib/cudadrv/state.jl:326
 [3] top-level scope
   @ REPL[2]:1
 [4] top-level scope
   @ /scratch/pc2-mitarbeiter/bauerc/.julia/packages/CUDA/t62lT/src/initialization.jl:52

This is CUDA.jl version v3.8.1. At least, this line is broken. I guess it is a function nowadays (for task-localness), so parentheses seem to be missing. However, note that even if that was fixed, the following line only sets default_math_mode and doesn't influence any tasks that already exist (or am I misunderstanding something?). So even with parentheses added we have

julia> CUDA.math_mode!(CUDA.FAST_MATH; precision=:Float16)

julia> CUDA.math_precision()
:TensorFloat32
@carstenbauer carstenbauer added the bug Something isn't working label Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant