Skip to content

Disable Float16 on the CPU backend #609

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

Merged
merged 3 commits into from
Jun 10, 2025
Merged

Disable Float16 on the CPU backend #609

merged 3 commits into from
Jun 10, 2025

Conversation

vchuravy
Copy link
Member

Currently fails with:

RROR: LoadError: InvalidIRError: compiling MethodInstance for KernelAbstractions.gpu_init_kernel(::KernelAbstractions.CompilerMetadata{KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.DynamicCheck, Nothing, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, KernelAbstractions.NDIteration.NDRange{1, KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.DynamicSize, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}}}, ::KernelAbstractions.POCL.CLDeviceVector{Float16, 1}, ::typeof(zero), ::Type{Float16}) resulted in invalid LLVM IR
Reason: unsupported use of half value
Stacktrace:
  [1] macro expansion
    @ ~/.julia/packages/LLVM/2JPxT/src/interop/base.jl:39
  [2] macro expansion
    @ ./none:0
  [3] pointerset
    @ ./none:0
  [4] unsafe_store!
    @ ~/.julia/packages/LLVM/2JPxT/src/interop/pointer.jl:88
  [5] arrayset_bits
    @ ~/.julia/packages/KernelAbstractions/JUTlQ/src/pocl/device/array.jl:139
  [6] #arrayset
    @ ~/.julia/packages/KernelAbstractions/JUTlQ/src/pocl/device/array.jl:130
  [7] setindex!
    @ ~/.julia/packages/KernelAbstractions/JUTlQ/src/pocl/device/array.jl:171
  [8] macro expansion
    @ ~/.julia/packages/KernelAbstractions/JUTlQ/src/KernelAbstractions.jl:819
  [9] gpu_init_kernel
    @ ~/.julia/packages/KernelAbstractions/JUTlQ/src/macros.jl:185
 [10] gpu_init_kernel
    @ ./none:0

cc: @maleadt

@vchuravy vchuravy mentioned this pull request Jun 10, 2025
7 tasks
@@ -48,6 +48,7 @@ end
supports_fp16 = "cl_khr_fp16" in dev.extensions
supports_fp64 = "cl_khr_fp64" in dev.extensions


# create GPUCompiler objects
target = SPIRVCompilerTarget(; supports_fp16, supports_fp64, version = v"1.2", kwargs...)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we assert here?

@maleadt
Copy link
Member

maleadt commented Jun 10, 2025

See JuliaGPU/OpenCL.jl#312

@vchuravy vchuravy merged commit b22a3e6 into main Jun 10, 2025
27 of 29 checks passed
@vchuravy vchuravy deleted the vc/benchmarks_fix branch June 10, 2025 09:01
Copy link
Contributor

Benchmark Results

main 15fad45... main / 15fad45...
saxpy/default/Float32/1024 0.0442 ± 0.029 ms 0.0435 ± 0.029 ms 1.02 ± 0.95
saxpy/default/Float32/1048576 0.455 ± 0.022 ms 0.451 ± 0.028 ms 1.01 ± 0.079
saxpy/default/Float32/16384 0.0571 ± 0.027 ms 0.0546 ± 0.026 ms 1.04 ± 0.69
saxpy/default/Float32/2048 0.0457 ± 0.026 ms 0.0445 ± 0.026 ms 1.03 ± 0.83
saxpy/default/Float32/256 0.0431 ± 0.03 ms 0.0446 ± 0.029 ms 0.965 ± 0.92
saxpy/default/Float32/262144 0.156 ± 0.025 ms 0.153 ± 0.025 ms 1.02 ± 0.23
saxpy/default/Float32/32768 0.0608 ± 0.026 ms 0.059 ± 0.025 ms 1.03 ± 0.63
saxpy/default/Float32/4096 0.0491 ± 0.023 ms 0.0487 ± 0.024 ms 1.01 ± 0.68
saxpy/default/Float32/512 0.0463 ± 0.029 ms 0.0455 ± 0.029 ms 1.02 ± 0.91
saxpy/default/Float32/64 0.0428 ± 0.029 ms 0.042 ± 0.028 ms 1.02 ± 0.96
saxpy/default/Float32/65536 0.0754 ± 0.027 ms 0.0713 ± 0.026 ms 1.06 ± 0.53
saxpy/default/Float64/1024 0.0442 ± 0.029 ms 0.0437 ± 0.029 ms 1.01 ± 0.93
saxpy/default/Float64/1048576 0.57 ± 0.061 ms 0.511 ± 0.05 ms 1.12 ± 0.16
saxpy/default/Float64/16384 0.0597 ± 0.026 ms 0.057 ± 0.027 ms 1.05 ± 0.67
saxpy/default/Float64/2048 0.0448 ± 0.026 ms 0.0447 ± 0.026 ms 1 ± 0.82
saxpy/default/Float64/256 0.0452 ± 0.029 ms 0.0448 ± 0.029 ms 1.01 ± 0.93
saxpy/default/Float64/262144 0.169 ± 0.027 ms 0.167 ± 0.028 ms 1.01 ± 0.23
saxpy/default/Float64/32768 0.069 ± 0.025 ms 0.0647 ± 0.026 ms 1.07 ± 0.58
saxpy/default/Float64/4096 0.0488 ± 0.024 ms 0.0485 ± 0.023 ms 1.01 ± 0.69
saxpy/default/Float64/512 0.0429 ± 0.029 ms 0.0437 ± 0.029 ms 0.983 ± 0.93
saxpy/default/Float64/64 0.0415 ± 0.029 ms 0.041 ± 0.028 ms 1.01 ± 0.99
saxpy/default/Float64/65536 0.087 ± 0.026 ms 0.0847 ± 0.026 ms 1.03 ± 0.44
saxpy/static workgroup=(1024,)/Float32/1024 0.0436 ± 0.029 ms 0.0425 ± 0.029 ms 1.03 ± 0.97
saxpy/static workgroup=(1024,)/Float32/1048576 0.455 ± 0.021 ms 0.44 ± 0.021 ms 1.03 ± 0.067
saxpy/static workgroup=(1024,)/Float32/16384 0.0535 ± 0.025 ms 0.0518 ± 0.025 ms 1.03 ± 0.69
saxpy/static workgroup=(1024,)/Float32/2048 0.0436 ± 0.027 ms 0.0439 ± 0.025 ms 0.995 ± 0.83
saxpy/static workgroup=(1024,)/Float32/256 0.0449 ± 0.027 ms 0.0448 ± 0.027 ms 1 ± 0.84
saxpy/static workgroup=(1024,)/Float32/262144 0.154 ± 0.026 ms 0.152 ± 0.025 ms 1.02 ± 0.24
saxpy/static workgroup=(1024,)/Float32/32768 0.0581 ± 0.026 ms 0.0577 ± 0.025 ms 1.01 ± 0.63
saxpy/static workgroup=(1024,)/Float32/4096 0.0469 ± 0.024 ms 0.0462 ± 0.025 ms 1.02 ± 0.76
saxpy/static workgroup=(1024,)/Float32/512 0.0512 ± 0.028 ms 0.0455 ± 0.028 ms 1.12 ± 0.92
saxpy/static workgroup=(1024,)/Float32/64 0.0481 ± 0.025 ms 0.0491 ± 0.025 ms 0.98 ± 0.72
saxpy/static workgroup=(1024,)/Float32/65536 0.0722 ± 0.026 ms 0.0698 ± 0.025 ms 1.03 ± 0.53
saxpy/static workgroup=(1024,)/Float64/1024 0.0424 ± 0.029 ms 0.0427 ± 0.028 ms 0.993 ± 0.94
saxpy/static workgroup=(1024,)/Float64/1048576 0.572 ± 0.054 ms 0.492 ± 0.055 ms 1.16 ± 0.17
saxpy/static workgroup=(1024,)/Float64/16384 0.0561 ± 0.025 ms 0.0543 ± 0.026 ms 1.03 ± 0.67
saxpy/static workgroup=(1024,)/Float64/2048 0.0432 ± 0.026 ms 0.0438 ± 0.025 ms 0.987 ± 0.82
saxpy/static workgroup=(1024,)/Float64/256 0.0444 ± 0.027 ms 0.0462 ± 0.027 ms 0.961 ± 0.8
saxpy/static workgroup=(1024,)/Float64/262144 0.164 ± 0.028 ms 0.164 ± 0.028 ms 0.999 ± 0.24
saxpy/static workgroup=(1024,)/Float64/32768 0.0646 ± 0.026 ms 0.0619 ± 0.026 ms 1.04 ± 0.6
saxpy/static workgroup=(1024,)/Float64/4096 0.046 ± 0.025 ms 0.0473 ± 0.025 ms 0.974 ± 0.74
saxpy/static workgroup=(1024,)/Float64/512 0.0456 ± 0.028 ms 0.0477 ± 0.028 ms 0.957 ± 0.82
saxpy/static workgroup=(1024,)/Float64/64 0.0438 ± 0.027 ms 0.0481 ± 0.027 ms 0.911 ± 0.77
saxpy/static workgroup=(1024,)/Float64/65536 0.0834 ± 0.027 ms 0.083 ± 0.027 ms 1.01 ± 0.46
time_to_load 1.33 ± 0.011 s 1.32 ± 0.0079 s 1.01 ± 0.01

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

Copy link

codecov bot commented Jun 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.52%. Comparing base (4981147) to head (15fad45).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #609   +/-   ##
=======================================
  Coverage   47.52%   47.52%           
=======================================
  Files          22       22           
  Lines        1715     1715           
=======================================
  Hits          815      815           
  Misses        900      900           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy