frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

GEMM Tutorial and UlmBLAS

3•michael-lehn•8h ago
In 2014 I wrote a tutorial on how to write an efficient matrix multiplication that can achieve near peak performance. This is actually not achieved by some Strassen algorithm variant. It's achieved through a cache friendly algorithm (exploiting the cache hierarchy) and SIMD register instructions.

The tutorial showed how to achieve that step by step. Beginning with a naive implementation using three loops. Then using buffers to first cache matrix blocks and then performing the matrix product block wise. That actually means you make copies of blocks and then do computations with the blocks. Sounds stupid but makes sense: Assume you have square N x N blocks then cost of make making a copy is O(N^2) and for the computation it's O(N^3). If the computation with the copied/cached blocks is much faster this actually pays of.

Anyway the details are explained in the tutorial. As the university web server has changed many times after 2014 I moved it to GitHub: https://github.com/michael-lehn/gemm-tutorial

From the tutorial I created ulmBLAS (ulm makes sense, as I work at Ulm University) which is a complete BLAS implementation. Recently I started with a tutorial for the matrix multiplication with Cuda. Currently there is not much text, I just outlined a possible step by step approach to go from naive to a performant implementation (actually the goal was to be on par with NVIDIA's cuBLAS; but it's more on parish ... but I think still gives an idea). It in the cuda subdirectory of ulmBLAS: https://github.com/michael-lehn/ulmBLAS

Comments

michael-lehn•8h ago
Ups, screwed up the title. Should have been "Show HN: ..."

Tell HN: Scribd Breached

125•x______________•3h ago•51 comments

Ask HN: Is the Microsoft buyout just a long overdue correction?

2•sky2224•5m ago•0 comments

Tell HN: X is opening any tweet link in a webview whether you press it or not

20•stillatit•5h ago•1 comments

Ask HN: What's it like working at Google nowadays? Core teams like Search, Ads?

39•karakoram•13h ago•26 comments

Ask HN: Is applying to Y Combinator worth it if you aren't an insider?

15•all2•11h ago•10 comments

Ask HN: Are most of you using HN Replies? Or what else do you use?

5•Gooblebrai•6h ago•7 comments

GEMM Tutorial and UlmBLAS

3•michael-lehn•8h ago•1 comments

"Wrong" Email

23•rbmm•13h ago•4 comments

Ask HN: Opus 5.5 suddenly dumb as rocks?

30•jahala•1d ago•31 comments

Ask HN: Hack

9•throwaway3309•16h ago•3 comments

Ask HN: Are you putting off hardware upgrades because of AI coding tools?

4•winrid•13h ago•0 comments

Ask HN: Are you using a custom harness?

8•japhyr•20h ago•6 comments

Ask HN: Do you have side-projects that generate >$500 revenue/month?

34•learner_yearner•1d ago•16 comments

Ask HN: Are Knuth's Stanford Pages Down?

8•weinzierl•1d ago•4 comments

Tell HN: Claude Code adds your email to the prompt, the LLM sends it to websites

31•TekMol•1d ago•3 comments

Ask HN: Is your leadership pushing you to skip dev review?

10•arm32•1d ago•7 comments

Ask HN: Antrophic tightened usage limits?

5•lukan•1d ago•0 comments

Ask HN: How are you using AI in your personal life?

3•whall6•1d ago•4 comments

Ask HN: Sitting on unused OpenAI / Anthropic / AWS credits that will expire?

3•xiaomaijj•1d ago•2 comments

Ask HN: Should I be polite to my agent or should I treat it like shit?

5•d--b•1d ago•12 comments

Ask HN: Why are there not more terminal apps?

5•lucasov•1d ago•9 comments

Ask HN: What's your iPhone Duo experience so far?

4•dgellow•1d ago•1 comments

Ask HN: Are you tired too in this AI era?

144•mellosty•21h ago•139 comments

Expericencing an issue in Gmail where emails do not delete in Firefox

9•rc_kas•3d ago•4 comments

Ask HN: Is it not possible to enroll for Apple Developer anymore?

32•olalonde•5d ago•17 comments

Ask HN: Do you still read clean code and software architecture books?

21•pelcg•4d ago•10 comments

Ask HN: Alternative to Tldraw Draw Fast?

4•outlore•2d ago•1 comments

You've reached the end!