Re: FP16 Support? - Mailing list pgsql-hackers

From Kohei KaiGai
Subject Re: FP16 Support?
Date
Msg-id CAOP8fzbaKtsxhEMmtLqWF-ORCVkfwTz-SEfnB3pFSmwpc+0aig@mail.gmail.com
Whole thread Raw
In response to Re: FP16 Support?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
2017-11-14 10:21 GMT+09:00 Tom Lane <tgl@sss.pgh.pa.us>:
> Kohei KaiGai <kaigai@heterodb.com> writes:
>> How about your thought for support of half-precision floating point,
>> FP16 in short?
>
> This sounds like a whole lotta work for little if any gain.  There's not
> going to be any useful performance gain from using half-width floats
> except in an environment where it's the individual FLOPs that dominate
> your costs.  PG is not designed for that sort of high-throughput
> number-crunching, and it's not likely to get there anytime soon.
>
> When we can show real workloads where float32 ops are actually the
> dominant time sink, it would be appropriate to think about whether
> float16 is a useful solution.  I don't deny that we could get there
> someday, but I think putting in float16 now would be a fine example
> of having your priorities reversed.
>
A typical workload I expect is, a data-scientist stores more than million
records which contains feature vectors hundreds or thousands dimension.
It consumes storage space according to the width and number of items,
and it also affects to the scan performance. In addition, it may need
extra data format conversion if user's script wants to process the feature
vector as half-precision floating point.

If a record contains a feature vector with 1000 dimension by FP32,
a million records consume 4GB storage space.
In case when FP16 is sufficient, it consumes only half of space, thus,
it takes half of time to export data arrays from the database.

Of course, our own extension can define own "half" or "float2" data types
regardless of the core feature, however, I thought it is a useful feature
for other people also.

Thanks,
-- 
HeteroDB, Inc / The PG-Strom Project
KaiGai Kohei <kaigai@heterodb.com>


pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: [HACKERS] A GUC to prevent leader processes from running subplans?
Next
From: Kohei KaiGai
Date:
Subject: Re: FP16 Support?