Rivflyyy/HappyTorch

A PyTorch coding practice platform — covering LLM, Diffusion, PEFT, and more A friendly environment to help you deeply understand deep learning components through hands-on practice. Like LeetCode, but for tensors. Self-hosted. Supports both Jupyter and Web interfaces.

What it solves

Many people read deep learning papers but struggle to implement the core ideas from scratch. Interview questions like "write softmax" or "implement MultiHeadAttention" often cause a blank mind. HappyTorch gives you a hands-on environment to systematically practice building Transformer components, LoRA, Diffusion modules, RLHF algorithms, and more.

How it works

HappyTorch provides 36 curated problems that range from basic activation functions to full architectures and advanced training methods. You implement a function or class (e.g., relu or MultiHeadAttention) in PyTorch. The built-in judge runs your code against multiple test cases, checking numerical correctness with torch.allclose, verifying gradients via autograd, and testing edge cases. You get instant pass/fail feedback. You can do this in either a web interface (with a Monaco editor) or Jupyter notebooks. If stuck, you can request hints or view reference solutions.

Who it's for

Deep learning learners who want to move from reading papers to actually coding models, and anyone preparing for machine learning interviews that include live coding of model components.

Highlights

  • 36 auto-graded problems covering LLM, Diffusion, PEFT, and RLHF topics
  • Two interfaces: a LeetCode-like web UI or Jupyter notebooks
  • No GPU required; runs on CPU
  • Self-hosted with Docker support
  • Hints and reference solutions included
  • Progress tracking saved locally
  • Online practice available at happytorch.wavetao.top

Related

  • Project
  • Project
  • Project
  • Project