Taras Tsugrii (@ttsugrii) profile picture

Software Engineer with passion for performance, algorithms and distributed systems as a means to deliver reliable and delightful experiences to users.

Seattle, WA
Joined January 2021
Photo by Taras Tsugrii (@ttsugrii)Photo by Taras Tsugrii (@ttsugrii)Photo by Taras Tsugrii (@ttsugrii)Photo by Taras Tsugrii (@ttsugrii)Photo by Taras Tsugrii (@ttsugrii)Photo by Taras Tsugrii (@ttsugrii)Photo by Taras Tsugrii (@ttsugrii)
your GPU benchmarks are lying to you zeros: 295 TFLOPS random values: 257 TFLOPS same GPU. same operation. 15% difference. the VALUES you multiply change how fast multiplication runs why?
1
28
here's what's happening: every transistor flip (0→1 or 1→0) costs power random data = maximum chaos = billions of transistors flipping = power limit hit = clock throttling zeros = nothing changes = no extra power = full speed
1
17
Every CUDA kernel launch costs 10-28 μs. That sounds small until you do the math: You need 20 MILLION FLOPs just to match the launch overhead. Most ML ops don't come close. Here's why this matters 🧵
1
23
The α-β model explains all performance: T = α + n/β α = fixed startup cost n/β = time for actual work For CUDA kernels: • α = 10-28 μs (launch overhead) • β = compute throughput If α > n/β, you're latency-bound.
1
15
System design is about trade-offs. Math is the language of trade-offs. I wrote a free book on the math of distributed LLM training—where trade-offs exist at every level and interact in non-obvious ways. 📖 ttsugriy.github.io/distribut…
3
149
Training a 96-layer transformer? Activations alone need 25GB. RevNets fix this with one trick: additive coupling. y₁ = x₁ + F(x₂) y₂ = x₂ + G(y₁) Invert to reconstruct activations → O(1) memory instead of O(depth). New chapter: ttsugriy.github.io/performan…
2
24
How does a chess engine hash millions of positions per second? Not by rehashing 64 squares each time. Two XOR operations. O(1). XOR is its own inverse: a ⊕ a = 0 Adding = removing. Same operation. New post on Zobrist hashing, rsync, and CRDTs 👇 ttsugriy.github.io/perf-bits…
2
19
I kept writing blog posts about why ML optimizations work: - FlashAttention → associativity - LoRA → separability - Batching → linearity Then I realized they were all chapters of the same book. So I wrote it. Free, interactive, open source: ttsugriy.github.io/performan…
1
46
PyTorch's compilation and matrix multiplication. Or a case of missed optimizations. open.substack.com/pub/softwa…
55
strcmp vs strncmp Or why it's useful to know the size. open.substack.com/pub/softwa…
46
Roaring bitmaps are the unsung heroes of data compression! These nifty data structures are the secret sauce behind blazing-fast queries and efficient storage in analytics and search engines. Check out how they are used in FeatureBase youtu.be/M-w_-4YnWXU?si=FZHd…
1
2
18
1,383
When I see things like "How is Haskell faster than C?" ( youtu.be/-C_hqWGlvnY?si=wBKk…) I get a different question - why do some people think Haskell is faster than C? I suspect that it's because in Haskell, the code runs so fast, you can't even see it, and neither can anyone else!
1
62
Faster reservoir sampling. Or taking advantage of better algorithms. open.substack.com/pub/softwa…
21
Vectorizing utf8_length_from_utf32. Or vectorization != better performance. open.substack.com/pub/softwa…
25
In the depths of our curiosity, we may discover the profound beauty that surrounds us. youtu.be/dFIqNZ8VbRY?si=dL8h…
1
67
Python's perceived slowness for complex scientific problems is often a result of using it in contexts where it's not the most efficient tool. youtu.be/maPozWKuv98?si=7tCG…
2
55
Fast has_hex_prefix check. Or SIMD using uint16_t. open.substack.com/pub/softwa…
25
I still don't think that mixing implementation details like indices and data is a good idea. If ugly queries and maintainability are not convincing enough consider performance implications of using them instead of highly optimized composite hash indices youtu.be/5aezDBaNfcc?si=SxZ5…
1
44
Columnar format is the data architect's best friend. Not a day goes by without me discovering its new applications. Automerge (youtu.be/Mr0a5KyD6BU?si=36Kc…) represents editing history in a columnar format for efficient storage and processing
2
59
Faster matching name search in rustc. Or using cheaper ways to maintain relations. open.substack.com/pub/softwa…
19
Adding unsafe code to rustc. Or why it's good to understand algorithm invariants. open.substack.com/pub/softwa…
16
Avoiding unnecessary movements. Or fewer reverse calls in rustc. open.substack.com/pub/softwa…
16