‹ BackHN Continuity

Thread

Show HN: Maple-Preview – Ternary 20B MoE running at 120 tok/s on a iPhone

169 points · 52 comments · edwardbzhang

  1. peter_d_sherman · · focus · HN ↗
    >"At ultra-low bitwidths,

    matrix multiplication can be effectively replaced with additions

    , lowering the total arithmetic workload needed to infer through a model."

    Interesting! I never knew that before... I will have to do some more research on this, but yes, it definitely sounds possible!

    (Also (and this is just a wild guess/hunch here!)

    in theory, matrix multiplication could be replaced with pre-computed cached lookups from a lookup table in memory

    if, if and only if the resultant pre-computed lookup table of result matrices could fit into memory available!

    In other words, think of a Matrix not as a 2D array, but as a 1D string. Think of the Matrix multiply operation as first appending the 1D string of the first matrix to the 1D string of the second matrix, then using that string as a Key to look-up a precomputed result in Memory...

    Of course, the limitation to this approach is the availability of memory relative to the permutations of input values... It could work -- but only for smaller matrices... which leads to another strange idea... in that set of pre-computed matrix permutations, there might be duplicates... figure out a way to put duplicates in memory only once (could use pointers or some other scheme to do this) and you could theoretically store more matrices in the same memory and/or slightly larger matrices!

    Anyway, just rambling out loud! :-)

    Remember, "almost all programming can be viewed as an exercise in caching" to quote the legendary programmer Terje Mathisen! :-) )

    Anyway, great article!

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.