Core concept
Manual fusion: write CUDA/Triton kernel. Auto: torch.compile, XLA, TorchInductor.
Advertisement
How it works
Complex ops hard to fuse well. Compiler-generated may miss opportunities.
Advertisement
Trade-offs + gotchas
Reduce memory bandwidth pressure. Elementwise + reduction chains classic case.