[{"data":1,"prerenderedAt":392},["ShallowReactive",2],{"project-39714053":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":33,"aspects":34,"strip":43,"post_text":45,"what":46,"said":60,"maker_in_thread":144,"shape":155,"grid":160,"attempts":346,"same_week":355,"maker_shows":42,"maker_hidden":384,"reader_version":385,"card":386},"39714053","algebraic-nnhw","Matrix Multiplication with Half the Multiplications","title","Show HN: Matrix Multiplication with Half the Multiplications","https:\u002F\u002Fgithub.com\u002Ftrevorpogue\u002Falgebraic-nnhw","github.com","emacs28",1710498997,2024,310,77,192,3515,6,"legend","hardware","accelerator architecture","other",[24,25,26,27],"matrix multiplication","fixed-point accelerator","inner product","hardware multipliers","debated",-0.083,{"positive":18,"neutral":31,"mixed":32,"critical":31},8,0,22,{"idea":35,"performance":38,"design":40,"docs":41},{"positive":36,"critical":37},4,1,{"positive":32,"critical":39},5,{"positive":32,"critical":37},{"positive":42,"critical":37},2,[44,37,32,32,32,44,37,44,37,32,32,32,39,32,37,44,44,32,32,32,37,44,32,32,37,32,37,39,32,32,32,32,32,32,32,44,44,39,39,39],3,null,{"problem":47,"audience":45,"pricing":45,"motivation":45,"time_to_build":45,"stack":58,"openness":59,"stage":59,"team_size":59},{"value":48,"source":49,"evidence":50},"Matrix multiplication needs many multiplier units; the approach reduces multiplications roughly by half","maker",[51,54],{"id":52,"by":11,"text":53},"39715061","Thanks, good summary. Regarding numerical stability, the application is for fixed-point arithmetic, and therefore numerical stability is not an issue (the result is identical…",{"id":55,"by":56,"text":57},"39714991","Someone","> What is the Big O run time on this? The claim is they’re dropping half the multiplications, so it isn’t doing anything for Big O. > If you want to improve the project…",[],"unknown",{"praise":61,"objections":74,"requests":106,"questions":114,"alternatives":129},[62],{"value":63,"source":64,"evidence":65},"Clever trick for hardware matmul with fewer multipliers","commenter",[66,70],{"id":67,"by":68,"text":69},"39719262","pclmulqdq","\"Conventional fixed-point MM\" is a large suite of algorithms. It is correct that this is a 2x reduction in MULs compared to naive fixed-point matrix multiply, but there is a…",{"id":71,"by":72,"text":73},"39714778","stephencanon","The readme doesn't explain much, but the introduction to the paper itself is quite approachable. As for whether it's groundbreaking or not ... it's a neat readily-accessible…",[75,92,99],{"value":76,"source":64,"evidence":77},"Floating point accuracy and numerical stability are unclear or poor",[78,82,85,89],{"id":79,"by":80,"text":81},"39715184","yorwba","On the other hand, if you tried it with floating point, you'd lose significant digits. Since the approach is to sum (a[i] + b[i+1])(a[i+1] + b[i]) and subtract the sums of…",{"id":83,"by":68,"text":84},"39715277","There are a lot of matrix multiplication algorithms out there with a lot of pluses and minuses. It's always a balance of accuracy, runtime, and scaling. This one probably has bad…",{"id":86,"by":87,"text":88},"39717261","p1esk","For floating point? Are you sure?",{"id":90,"by":68,"text":91},"39717735","The paper cited is about hardware, where there is no accuracy tradeoff because you control the numerical precision completely and use fixed point. In a software implementation,…",{"value":93,"source":64,"evidence":94},"Hardware benefit requires committing to custom hardware matching dimensions",[95],{"id":96,"by":97,"text":98},"39715790","lupire","It's not just a software algorithm. It's a hardware architecture optimization. To benefit, you have to build hardware that matches the dimensions of the algorithm. That's an…",{"value":100,"source":64,"evidence":101},"README is unclear about the improvement",[102],{"id":103,"by":104,"text":105},"39714468","barfbagginus","This readme does a really poor job of explaining what the improvement is or how they drop half the multiplications. What is the Big O run time on this? Is this shifting the known…",[107],{"value":108,"source":64,"evidence":109},"Comparison against OpenBLAS and cuBLAS performance",[110],{"id":111,"by":112,"text":113},"39738893","1letterunixname","Wonder how well it compares to openblas and cublas.",[115,122],{"value":116,"source":64,"evidence":117},"Why is this not already used in accelerators?",[118],{"id":119,"by":120,"text":121},"39714396","halflings","This looks pretty cool! What's the catch? e.g. why isn't this already implemented in accelerators, is it really just a forgotten algorithm, or this has some implications on the…",{"value":123,"source":64,"evidence":124},"Does it work for floating point?",[125,126],{"id":86,"by":87,"text":88},{"id":127,"by":87,"text":128},"39718843","I just looked at the paper: the answer is no, floating point is not supported.",[130,137],{"value":131,"source":64,"evidence":132},"Strassen and other sub-cubic matrix multiplication algorithms",[133],{"id":134,"by":135,"text":136},"39718054","abetusk","I don't know why this answer is getting downvoted. This is absolutely correct. W. Miller has a paper discussing, under conditions of numerical stability, O(n^3) multiplications…",{"value":138,"source":64,"evidence":139},"Tropical and log semiring matrix methods",[140],{"id":141,"by":142,"text":143},"39716950","michelpp","This is very cool and a real interesting read! For those in the comments confused about how this is better, the paper is talking about synthesizing matrix multiplication…",{"comments":39,"answered":44,"key":145},[146,149,152],{"id":147,"text":148},"39714576","IMHO, for fixed-point MM accelerators, there is no catch, I think it's an overlooked algorithm. It's based on an algorithm by Winograd who coincidentally also proposed another…",{"id":150,"text":151},"39718761","For everyone discussing the reduced accuracy\u002Fnumerical stability of the algorithms in floating-point, this is true. But note that the application of the algorithms in the work is…",{"id":153,"text":154},"39715954","> you have to build hardware that matches the dimensions of the algorithm Yes the benefits are realized in custom hardware designs as opposed to software, however, the hardware…",{"commenters":156,"max_depth":157,"maker_replies":39,"first_comment_mins":158,"lifespan_hours":159},46,7,62,146,[161,163,164,166,170,173,175,178,181,184,186,189,190,194,195,198,199,200,201,204,205,207,209,211,213,215,217,219,221,223,226,229,231,234,237,240,242,245,247,251,254,255,258,261,264,267,270,272,275,278,281,282,285,287,290,293,296,299,301,304,306,308,311,314,317,319,321,323,326,330,333,336,337,338,340,344],[119,32,44,162,120,32],"project\u002Fneutral\u002Fidea",[147,32,32,162,11,37],[79,32,37,165,80,32],"project\u002Fcritical\u002Fperformance",[167,32,32,168,169,32],"39715928","other\u002Fneutral\u002Fnone","OJFord",[171,32,32,168,172,32],"39717783","bee_rider",[174,32,32,168,169,32],"39719306",[176,32,32,168,177,32],"39737602","MrYellowP",[179,32,32,168,180,32],"39740633","SJC_Hacker",[182,32,32,168,183,32],"39727171","gojomo",[185,32,32,168,169,32],"39730229",[187,32,44,162,188,32],"39714599","mariocesar",[83,32,37,165,68,32],[191,32,32,192,193,32],"39717074","commenter\u002Fneutral\u002Fperformance","waynecochran",[86,32,32,192,87,32],[196,32,44,197,193,32],"39718591","project\u002Fneutral\u002Fperformance",[127,32,37,165,87,32],[90,32,32,192,68,32],[134,32,32,192,135,32],[202,32,32,192,203,32],"39718700","gyrovagueGeist",[150,32,32,197,11,37],[206,32,32,192,135,32],"39719086",[208,32,32,192,68,32],"39719274",[210,32,32,192,180,32],"39740664",[67,32,39,212,68,32],"project\u002Fpositive\u002Fidea",[214,32,32,192,87,32],"39720531",[216,32,32,192,180,32],"39740642",[218,32,32,192,87,32],"39741154",[96,32,37,220,97,32],"project\u002Fcritical\u002Fdesign",[153,32,32,222,11,37],"maker\u002Fneutral\u002Fdesign",[224,32,44,225,180,32],"39740618","project\u002Fneutral\u002Fdesign",[227,32,44,197,228,32],"39717572","adastra22",[230,32,32,197,11,37],"39777760",[232,32,32,168,233,32],"39719264","pbsd",[235,37,32,168,236,32],"39715033","ixaxaar",[238,37,32,239,80,32],"39715105","commenter\u002Fneutral\u002Fnone",[241,37,32,239,236,32],"39715279",[243,37,32,168,244,32],"39715951","rollingtide",[246,37,32,168,236,32],"39716425",[248,37,37,249,250,32],"39717641","project\u002Fcritical\u002Fidea","jebarker",[252,37,32,253,236,32],"39718198","commenter\u002Fneutral\u002Fidea",[141,42,44,162,142,32],[256,42,32,253,257,32],"39717424","pk-protect-ai",[259,42,32,253,260,32],"39720860","jhj",[262,42,32,168,263,32],"39720332","gatane",[265,42,32,168,266,32],"39721237","buybackoff",[268,42,32,168,269,32],"39726940","nextaccountic",[271,42,37,165,260,32],"39720475",[273,42,32,168,274,32],"39720758","bearzoo",[276,42,32,168,277,32],"39721305","btown",[279,44,37,165,280,32],"39714420","Drakim",[111,44,44,197,112,32],[283,36,39,212,284,32],"39718609","skykooler",[286,36,32,168,257,32],"39718704",[288,39,32,168,289,32],"39716476","Lucasoato",[291,39,32,168,292,32],"39716626","abeppu",[294,39,32,168,295,32],"39716713","roflmaostc",[297,39,32,168,298,32],"39717115","JohnKemeny",[300,39,32,168,292,32],"39721012",[302,39,32,239,303,32],"39716748","gizmo686",[305,39,32,168,298,32],"39717096",[307,39,32,239,289,32],"39717970",[309,39,32,239,310,32],"39724158","hnfong",[312,39,32,239,313,32],"39724769","akoboldfrying",[315,39,32,239,316,32],"39726813","ernesth",[318,39,32,239,310,32],"39739855",[320,39,32,168,172,32],"39719103",[103,18,37,322,104,32],"project\u002Fcritical\u002Fdocs",[324,18,39,325,188,32],"39714541","project\u002Fpositive\u002Fdocs",[327,18,32,328,329,32],"39714723","commenter\u002Fneutral\u002Fdocs","hackyhacky",[331,18,44,197,332,32],"39715909","VogonPoetry",[334,18,32,168,335,32],"39716448","jart",[71,18,39,212,72,32],[55,18,39,212,56,32],[52,18,32,339,11,37],"maker\u002Fneutral\u002Fperformance",[341,18,32,342,343,32],"39717343","commenter\u002Fcritical\u002Fnone","eigenket",[345,18,39,325,104,32],"39722924",[347,351,354],{"id":348,"t":349,"points":350,"comments":32},"39211325",1706746313,18,{"id":352,"t":353,"points":42,"comments":32},"39356775",1707824554,{"id":4,"t":12,"points":14,"comments":15},[356,361,366,371,375,380],{"id":357,"name":358,"points":359,"category":360},"39706004","Skyvern",422,"ai",{"id":362,"name":363,"points":364,"category":365},"39759325","jnv",373,"dev_tools",{"id":367,"name":368,"points":369,"category":370},"39756325","Godspeed",328,"productivity",{"id":372,"name":373,"points":374,"category":365},"39770908","GritQL",280,{"id":376,"name":377,"points":378,"category":379},"39755858","Causal 2.0",261,"web_saas",{"id":381,"name":382,"points":383,"category":360},"39726781","flash-attention-minimal",230,false,"v2",{"id":387,"name":5,"line":6,"ai":384,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":388,"top":18,"kw":389,"maker":11,"domain":10,"tier":19,"attempts":44,"strip":390,"url":9,"mix":391,"praise":63,"objection":76,"sub":21},39714053,-0.08,[24,25,26,27],"3100031310005013300013001015000000033555",[18,31,32,31],1794036651298]