How microsoft/tilefusion works
Project type and purpose
• TileFusion is a high-level, modular C++/CUDA library for GPU tile processing with optional Python bindings (PyTorch extension).
• It provides header-only C++ primitives for tile layout, iterators, loaders/storers, and exposes select kernels (e.g., flash attention, fused GEMMs) to Python.
File structure
• Top-level build and config:
• CMakeLists.txt, Makefile, cmake/ (dependencies, external), .github/workflows, scripts/
• setup.py, pyproject.toml, requirements.txt (Python packaging & dev)
• Core C++ library:
• / (public headers: cell, kernels, types, util, traits)
• src/ (kernel implementations .cu, torch_bind.cc, cuda_utils.cc)
• Third-party dependencies:
• 3rd-party/cutlass, 3rd-party/googletest
• Examples & benchmarks:
• examples/ (CUDA code snippets showing usage patterns)
• benchmarks/ (C++ and Python scripts measuring performance)
• Tests:
• tests/cpp (unit tests via GoogleTest and CUDA kernels)
• tests/python (pytest suites for Python ops)
README for additional insights
• Core concepts: separation of data flow vs. kernel configuration; three-level GPU memory abstraction (global, shared, register).
• Usage modes: header-only C++ library or Python package (via setup.py).
• Dependencies: C++20, CUDA 12+, PyTorch for Python.