Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. 16 bit float precision

16 bit float precision

Scheduled Pinned Locked Moved Solved C++ Gurus
6 Posts 5 Posters 784 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Q139
    wrote on last edited by Q139
    #1

    Hi,
    I am thinking of using half precision float to reduce memory usage as my software has large vectors of floats.

    Can I expect faster performance as less data requests from ram?
    Am I correc to assume that decimal precision of float16 is about 3-4decimal places?
    Is this fastest implementation of this data type or should look for other libraries?
    https://doc.qt.io/qt-5/qfloat16.html

    JonBJ aha_1980A 2 Replies Last reply
    0
    • Q Q139

      Hi,
      I am thinking of using half precision float to reduce memory usage as my software has large vectors of floats.

      Can I expect faster performance as less data requests from ram?
      Am I correc to assume that decimal precision of float16 is about 3-4decimal places?
      Is this fastest implementation of this data type or should look for other libraries?
      https://doc.qt.io/qt-5/qfloat16.html

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Q139 said in 16 bit float precision:

      Can I expect faster performance as less data requests from ram?

      I note the docs say:

      This implies that any arithmetic operation on a qfloat16 instance results in the value first being converted to a float. This conversion to and from float is performed by hardware when possible, but on processors that do not natively support half-precision, the conversion is performed through a sequence of lookup table operations.

      I don't know, does your hardware support half-precision floats?

      1 Reply Last reply
      4
      • Q Q139

        Hi,
        I am thinking of using half precision float to reduce memory usage as my software has large vectors of floats.

        Can I expect faster performance as less data requests from ram?
        Am I correc to assume that decimal precision of float16 is about 3-4decimal places?
        Is this fastest implementation of this data type or should look for other libraries?
        https://doc.qt.io/qt-5/qfloat16.html

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi @Q139,

        just to add to @JonB's good answer:

        Introduction to float 16 bit is here: https://en.wikipedia.org/wiki/Half-precision_floating-point_format

        Can I expect faster performance as less data requests from ram?

        The only correct answer to this question is: profile your program and decide afterwards.

        Regards

        Qt has to stay free or it will die.

        1 Reply Last reply
        4
        • S Offline
          S Offline
          SimonSchroeder
          wrote on last edited by
          #4

          I guess that half precision has been supported on GPUs for a while now. I thought this to be a relatively new feature on CPUs. However, here is an article from 2012 by Intel explaining hardware support for loading/storing (including conversion) of half precision floats: https://software.intel.com/content/www/us/en/develop/articles/performance-benefits-of-half-precision-floats.html

          So, I guess you can assume half precision floats on comparatively recent computers.

          1 Reply Last reply
          5
          • Q Offline
            Q Offline
            Q139
            wrote on last edited by Q139
            #5

            It worked out as good idea and,improved performance in my case(accessing 15+gb float arrays from ram)
            Probably with each ram access it was pulling twice as much to cpu cache and less ram access wait for cpu.

            Pablo J. RoginaP 1 Reply Last reply
            2
            • Q Q139

              It worked out as good idea and,improved performance in my case(accessing 15+gb float arrays from ram)
              Probably with each ram access it was pulling twice as much to cpu cache and less ram access wait for cpu.

              Pablo J. RoginaP Offline
              Pablo J. RoginaP Offline
              Pablo J. Rogina
              wrote on last edited by
              #6

              @Q139 said in 16 bit float precision:

              It worked out as good idea

              Nice, are you able to mark your post as solved then? Thanks.

              Upvote the answer(s) that helped you solve the issue
              Use "Topic Tools" button to mark your post as Solved
              Add screenshots via postimage.org
              Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved