[MPIWG Fortran] FP16 16-bit-floating-point
Bill Long
longb at cray.com
Fri Jun 16 11:57:56 CDT 2017
Hi Rolf,
The Fortran 2015 draft is close to finished. Its IEEE-isms are based on ISO/IEC/IEEE 60559:2011, and includes a lot of changes based on that standard. If this FP16 feature is part of that standard, then we should look into making a change now. Otherwise, it would likely wait for the next revision.
As Reinhold pointed out, the parameterized KIND scheme Fortran uses already permits identifying a KIND value for 16-bit floats, assuming the processor (i.e. compiler) knows about such a type.
Changes to the standard would be minimal - add REAL16 to the iso_fortran_env module, with the value of -1 if that kind of real is not supported, and the value of 2 for most compilers if it is. Changes to the compiler would be significant. So implementation would likely wait for customer demand.
Cheers,
Bill
> On Jun 16, 2017, at 2:44 PM, Rolf Rabenseifner <rabenseifner at hlrs.de> wrote:
>
> (Because I'm not member of j3, only Reinhold's or Rich's answers will be visible for j3)
>
> Based on Reinhold's answer, I make my questions more precise:
>
> - Are there already some activities in J3 on this FP16 topic?
>
> - When will the Fortran standard include REAL16 to support the new IEEE FP16 standard?
>
> Best regards
> Rolf
>
>
> ----- Original Message -----
>> From: "Reinhold Bader" <Reinhold.Bader at lrz.de>
>> To: "Rolf Rabenseifner" <rabenseifner at hlrs.de>, "fortran standards email list for J3" <j3 at j3-fortran.org>
>> Cc: "MPI-WG Fortran working group" <mpiwg-fortran at lists.mpi-forum.org>, "Atsushi Hori" <ahori at riken.jp>, "Martin Schulz"
>> <schulzm at llnl.gov>, "MPI WG Point To Point Communications working group" <mpiwg-p2p at lists.mpi-forum.org>
>> Sent: Friday, June 16, 2017 2:31:03 PM
>> Subject: AW: FP16 16-bit-floating-point
>
>> Hello Rolf,
>>
>> to the best of my knowledge, the answers are as follows:
>>
>> Q1: Not in the sense of having an explicit name like the REAL32, REAL64, REAL128
>> names for specific integer kinds that were added to Fortran 2008.
>> However, it is left free to implementors to create a new kind number in the
>> implementation that could be returned by SELECTED_REAL_KIND() and,
>> if IEEE conforming, by IEEE_SELECTED_REAL_KIND() and consequently all relevant
>> IEEE support routines.
>>
>> Q2: REAL*2 is (like REAL*8) a non-conforming notation (REAL*8 is supported as an
>> extension by many implementations), so the answer is no.
>> A proper declaration might look like
>>
>> integer, parameter :: rk = selected_real_kind(2,6) ! at least 2 decimal
>> digits and 6 maximal decimal exponent - hope I have this right ...
>> real(KIND=rk) :: x
>>
>> with the following caveats:
>> * the KIND that fits the requirement most closely will be used, so it might be
>> necessary to use the STORAGE_SIZE intrinsic to check what one gets.
>> * KIND numbers are non-portable, so might vary for one and the same kind between
>> implementations (at least one compiler I know deviates from all others I know).
>>
>> I checked three of the compilers I know: they currently do not support FP16.
>>
>> Regards
>> Reinhold
>>
>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Rolf Rabenseifner [mailto:rabenseifner at hlrs.de]
>>> Gesendet: Freitag, 16. Juni 2017 13:53
>>> An: fortran standards email list for J3 <j3 at j3-fortran.org>; Bader, Reinhold
>>> <Reinhold.Bader at lrz.de>
>>> Cc: MPI-WG Fortran working group <mpiwg-fortran at lists.mpi-forum.org>;
>>> Atsushi Hori <ahori at riken.jp>; Martin Schulz <schulzm at llnl.gov>; MPI WG
>>> Point To Point Communications working group <mpiwg-p2p at lists.mpi-
>>> forum.org>
>>> Betreff: FP16 16-bit-floating-point
>>>
>>> Hi all together,
>>>
>>> I'm sitting in the MPI Forum Meeting and we discuss the new IEEE FP16
>>> datatype.
>>>
>>> Questions to the Fortran atandardization body:
>>>
>>> - Does the Fortran Standardization Body has already a proposal for
>>> the new name in Fortran for this IEEE FP16?
>>>
>>> - Will be REAL*2 identical to IEEE FP16?
>>>
>>> Best regards
>>> Rolf
>>>
>>> --
>>> Dr. Rolf Rabenseifner . . . . . . . . . .. email rabenseifner at hlrs.de .
>>> High Performance Computing Center (HLRS) . phone ++49(0)711/685-65530 .
>>> University of Stuttgart . . . . . . . . .. fax ++49(0)711 / 685-65832 .
>>> Head of Dpmt Parallel Computing . . . www.hlrs.de/people/rabenseifner .
>>> Nobelstr. 19, D-70550 Stuttgart, Germany . . . . (Office: Room 1.307) .
>
> --
> Dr. Rolf Rabenseifner . . . . . . . . . .. email rabenseifner at hlrs.de .
> High Performance Computing Center (HLRS) . phone ++49(0)711/685-65530 .
> University of Stuttgart . . . . . . . . .. fax ++49(0)711 / 685-65832 .
> Head of Dpmt Parallel Computing . . . www.hlrs.de/people/rabenseifner .
> Nobelstr. 19, D-70550 Stuttgart, Germany . . . . (Office: Room 1.307) .
> _______________________________________________
> mpiwg-fortran mailing list
> mpiwg-fortran at lists.mpi-forum.org
> https://lists.mpi-forum.org/mailman/listinfo/mpiwg-fortran
Bill Long longb at cray.com
Principal Engineer, Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9143
Cray Inc./ 2131 Lindau Lane/ Suite 1000/ Bloomington, MN 55425
More information about the mpiwg-fortran
mailing list