Skip to content

Wrong Core.Intrinsics.have_fma(Float16) test #57783

Open
@giordano

Description

@giordano

This is a known issue, but there's no open ticket about it, so here we go: Core.Intrinsics.have_fma(Float16) always returns false also on hardware which natively supports this datatype:

julia/src/runtime_intrinsics.c

Lines 1759 to 1768 in a5abb6f

JL_DLLEXPORT jl_value_t *jl_have_fma(jl_value_t *typ)
{
JL_TYPECHK(have_fma, datatype, typ); // TODO what about float16/bfloat16?
if (typ == (jl_value_t*)jl_float32_type)
return jl_cpu_has_fma(32);
else if (typ == (jl_value_t*)jl_float64_type)
return jl_cpu_has_fma(64);
else
return jl_false;
}
The funny result is that, unlike fma, muladd actually uses half-precision fmadd instructions on hardware with native fp16: #57041 (comment)

This issue should hopefully be addressed by #57049.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions