Metal.jl icon indicating copy to clipboard operation
Metal.jl copied to clipboard

Add Support for BFloat16

Open tgymnich opened this issue 1 year ago • 3 comments

With Julia 1.11 coming up, we will have native support for BFloat16 https://github.com/JuliaLang/julia/pull/51470.

Metal also supports BFloat16 onwards from Apple6 GPU architecture.

M1 belongs to the Apple7 GPU family

https://developer.apple.com/documentation/metalperformanceshaders/mpsdatatype

tgymnich avatar Mar 04 '24 09:03 tgymnich

Hi, I would love to work on this issue.

Dsantra92 avatar Mar 12 '24 12:03 Dsantra92

Looks like precompilation fails for Metal.jl in 1.11 alpha 2 because of a version restriction in GPUCompiler.jl code.

Also there are multiple failures with current alpha if we ignore the code component for GPUCompiler.CodeCache like Metal.rand. Also the Core.BFloat16 is only partially implemented in 1.11 for tricking LLVM I suppose. For full usage we have to rely on BFloat16s.jl. I feel I should wait for 1.11 stable before starting working on this issue.

Dsantra92 avatar Mar 19 '24 20:03 Dsantra92

I suspect the version restriction is in place because the GPUCompiler probably needs to be updated for 1.11.

I believe the idea was to have minimal support in Julia base, and use packages to implement the full functionality, which can move much faster with releases and such.

ViralBShah avatar Mar 22 '24 15:03 ViralBShah