m-j-w / CpuId.jl

Ask the CPU for cache sizes, SIMD feature support, a running hypervisor, and more.
Other
54 stars 10 forks source link

ERROR: LoadError: This CPU does not provide information on cpuid leaf 0x00000004. #53

Open chriselrod opened 2 years ago

chriselrod commented 2 years ago

https://github.com/JuliaSIMD/VectorizationBase.jl/runs/6198591014?check_suite_focus=true#step:6:168

Could it return some sort of error code that I can check to use a generic fallback instead?

m-j-w commented 2 years ago

What would be your preferred behaviour ?

cachesize()     --> () | missing | nothing         # empty tuple, or 'missing', or 'nothing'
cachesize(lvl)  --> -1 | 0 | missing | nothing      # illegal value, zero or 'missing', or 'nothing'

Personally, I'd lean towards empty tuple and -1, or missing/nothing.

Missing/nothing could also easily be applied to all other functions instead of throwing exceptions. An illegal value would be difficult for functions that return booleans

chriselrod commented 2 years ago

I'd prefer nothing, as it's the standard of methods like findfirst, and will generally force you to handle it immediately or throw (as not many people define methods for nothing), so it's easier to find where it originated vs missing which will tend to propagate.

carstenbauer commented 2 years ago

We also see this error over at https://github.com/JuliaParallel/Hwloc.jl/pull/61 in our x86 CI. Note, however, that in only effects the Julia >= 1.7 runners (with CpuId.jl version 3.1). So I wonder what has changed in CpuId.jl since version 3.0, on first sight, this looks like a regression.

m-j-w commented 2 years ago

@carstenbauer this issue is about the failure behavior of the function if the hardware is not providing the expected information. The request is to report nothing rather than to throw an exception.