$ account facebookincubator
AITemplate is a deep learning compiler framework that transforms neural network models into optimized CUDA or HIP code for high-performance GPU inference. It features a frontend for model definition (similar to PyTorch), a compiler that applies graph optimizations (operator fusion, shape propagation), and backends that generate architecture-specific kernels. The framework supports model conversion from PyTorch via FX graph transformation and includes examples for vision (ResNet, ViT, Stable Diffusion), NLP (BERT), and object detection (Detectron2). Key innovations include a universal GEMM framework with flexible memory layouts, operator fusion patterns, and a tensor accessor abstraction for handling diverse memory layouts in generated code.
fastmod is a high-performance CLI tool for large-scale codebase refactoring, designed as a faster replacement for the original codemod. It recursively searches files in a directory tree using the `ignore` and `grep` crates (the same underlying libraries as ripgrep), applies regex-based substitutions, and presents diffs for interactive review or accepts all changes automatically. The tool supports multiline regex, glob/extension filtering, case-insensitive matching, fixed-string mode, external diff tools, and hidden/ignored file traversal. The architecture is a single Rust binary with two source files: `main.rs` containing all core logic (argument parsing, file walking, patching, and interactive prompts) and `terminal.rs` wrapping `crossterm` for terminal color and clearing. Execution can be either interactive (user reviews each diff) or fast (batch apply with optional `--accept-all`). The code is well-structured, leverages parallelism via `ignore::WalkParallel`, and includes a suite of integration tests. It does not expose a library API; all functionality is encapsulated in the binary.