‹ BackHN Continuity

Thread

A software thing I built: GPS on a 25MHz 486-SX

75 points · 24 comments · JPLeRouzic

  1. JPLeRouzic · · focus · HN ↗
    The author says:

    "It used Voronoi Cells and reduced most math to 8- and 16-bit integer calculations with one or two single-precision floating-point calculations."

    I wonder if it can be used to speed up LLM inference.

    1. Neywiny · · focus · HN ↗
      That's what quantization and stuff is, basically. So yes. Been done for years on all neural net types not just LLMs.
      1. JPLeRouzic · · focus · HN ↗
        Please can you provide some links to intro level articles?
        1. Neywiny · · focus · HN ↗
          This seems worth the read but I didn&#x27;t dig too deep <a href="https:&#x2F;&#x2F;medium.com&#x2F;@sergiopr89&#x2F;float-point-quantization-the-maths-behind-it-explained-for-everyone-fc674d313d67" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@sergiopr89&#x2F;float-point-quantization-the-...
      2. 4RealFreedom · · focus · HN ↗
        Quantization compresses the model’s parameters and you lose precision in the process. My understanding from the article was that precision wasn&#x27;t lost - &#x27;It actually had higher resolution than Extended-precision floating point math!&#x27;. The point of quantization is to make the model smaller to fit into available ram. I think the OP is referring to computation which is a different beast.
        1. Neywiny · · focus · HN ↗
          You may be conflating distillation, which may be a fault of other people getting it wrong. Going from floating to fixed point doesn&#x27;t change precision or size. It changes representation. For example, if all your values are between 0 and 1 or -1 and 1, you&#x27;re not using the entire range of a standard IEEE float. If you instead use Q31 format, you get basically 31 instead of 23 bits of mantissa. So it&#x27;s an increase in precision if and only if you can basically stretch your sub-range that you were using over a larger range of bit representations. You have to think of the total number of values. 32 bit is 4 billion. 80 bit extended precision is a lot more than that. But he didn&#x27;t say I think what his fixed point bit width was. That&#x27;s what matters.

          Now maybe you don&#x27;t need to represent 1&#x2F;2^32 in precision. Maybe you just need to know to 1&#x2F;8th. That&#x27;s where you can quantize to a lower precision to save space.

          But if you start with 32 bit float and quantize to 32 bit fixed, I struggle to think how that saves storage.

          1. 4RealFreedom · · focus · HN ↗
            I wasn&#x27;t conflating distillation. You are basically repeating what I said - you&#x27;re describing quantization. The OP was talking about changing the computation. The article says the 8- and 16-bit integer approach actually had higher resolution than the floating-point approach. You said we already had quantization to do this but quantization isn&#x27;t what the OP was describing.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.