Can you handle Anthropic engineer assignment?
Anthropic recently open-sourced a performance engineering take-home challenge, and it perfectly captures why LLM infrastructure needs expert-level engineers.
You're given a simulated processor: 12 ALU (Arithmetic Logic Unit - performs arithmetic and logical operations) slots, 6 vector ALU slots, limited loads/stores (variable assignment), and 1536 words of scratch memory. The task is to optimize a tree traversal kernel from its naive baseline.
You can think of it as PyTorch vs. hand-tuned CUDA, but stripped down to fundamentals. How do you transform the frontier LLM architecture into a best-performing sequence of low-level GPU operations leveraging high-performance instructions?
This mini-architecture mirrors exactly what happens inside real GPUs:
- VLIW slot limits = CUDA core constraints
- Scratch memory = shared memory and registers
- Vector operations (VLEN=8) = warp-level execution
- Memory access patterns = coalesced reads
Every optimization technique here translates directly to production ML systems.
Here are some typical optimization techniques that can be used for this task:
- Instruction packing: each cycle can contain 2-12 operations of each type.
- Vectorization: the same arithmetic operation can be done simultaneously for 8 numbers at once with SIMD.
- Loop unrolling: doing loops in batches that match the instruction parallelism greatly speeds things up.
- Memory access optimization: loading operations are expensive, therefore pre-loading in advance helps a lot.
- If statements can be replaced by arithmetic.
- Speculative optimizations: we can precompute the values of certain if-statements and check the condition later. If it is true, we already have the result in place; otherwise, do the normal sequential calculation.
But that's enough to get you to 3k-4k cycles in one evening - I've managed to do 4033 cycles. Claude Opus 4.5 matched the best human performance at ~1,790 cycles in a casual coding session. It hit ~1,363 cycles after extended optimization. And the best engineers can do even better!
What's your limit?
Link to the challenge: https://github.com/anthropics/original_performance_takehome.git
High Performance Computing Course: https://en.algorithmica.org/hpc/
MIT Course on a related topic: https://www.youtube.com/playlist?list=PLUl4u3cNGP63VIBQVWguXxZZi0566y7Wf
Deep dive into the problem: https://trirpi.github.io/posts/anthropic-performance-takehome/