OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Infrastructure & Serving

Magicompiler

MagiCompiler is a Python compiler and runtime augmentation framework built on PyTorch's torch.compile for Transformer-like large-model inference and training.

Independent OpenViST project profile, based on linked sources.

Magicompiler — OpenViST project profile in AI Infrastructure & Serving.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when you can modify a PyTorch Transformer workflow and want compiler-level optimization for inference or training, with CUDA-based setup documented by the project.

Who it is for

  • Developers optimizing Transformer-like model inference.
  • Teams compiling large-model training workloads with FSDP-aware layer-wise compilation.

Documented uses

  • Capture a Transformer inference workload across block boundaries for whole-graph compilation.
  • Compile training workloads layer by layer with FSDP-aware handling.
  • Manage memory and data movement through selective asynchronous offloading and heuristic activation recomputation.
  • Inspect compilation timelines, decompiled bytecode flows, split subgraphs, and backend artifacts using the included magi_depyf introspection toolkit.
Before you choose

Requirements & limits

The repository is public and licensed under Apache-2.0. The README documents local installation and a prebuilt Docker image.

  • Requires Python 3.12 or later, PyTorch 2.9.x or 2.12.x, and CUDA Toolkit.
  • CUTLASS is optional and required only for the documented matmul-plus-epilogue fusion pass on sm_90 or sm_120.
  • The quick-start example uses CUDA; the documentation does not specify a complete hardware support matrix.
  • The documented target is Transformer-like architectures, not a general-purpose compiler for arbitrary models.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install MagiCompiler from source

Set up the package locally using the documented source-install route.

Before you start

  • Python 3.12 or later
  • PyTorch 2.9.x or 2.12.x
  • CUDA Toolkit
  • Graphviz is optional and listed for FX graph visualization.

Steps

  1. Clone the MagiCompiler repository and change into its directory.

  2. Install the Python dependencies with pip install -r requirements.txt.

  3. Install the package for end users with pip install .

  4. Optionally install CUTLASS and configure CUDACXX and its build for the listed GPU architecture if the CUTLASS matmul-plus-epilogue fusion pass is needed.

Expected outcome

The local package is installed; CUTLASS enables the documented fusion pass, while the compiler can still work without that optional optimization.

Guide limitations

  • The documented requirements do not provide a full supported hardware matrix.
  • CUTLASS is required only for its specific fusion pass; the README says that optimization is skipped without it.
Source-based practical guide

Apply the compiler decorator to a Transformer block

Use the documented quick-start pattern to compile a core Transformer module.

Before you start

  • An installed MagiCompiler environment
  • A PyTorch Transformer block and CUDA device, as used in the README example

Steps

  1. Import torch, nn, and magi_compile.

  2. Decorate the Transformer block class with @magi_compile.

  3. Instantiate the model on CUDA and call it with inputs, as in the example.

Expected outcome

The example routes ordinary model calls through whole-graph compilation and demonstrates calls with different batch sizes.

Guide limitations

  • The example documents a Transformer block and CUDA execution; it does not establish compatibility with other architectures or hardware.
COMPARE OPTIONS

Compare options for Model inference and serving

These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.

ProjectDocumented purposePlatformAccess and requirements
MagicompilerCapture a Transformer inference workload across block boundaries for whole-graph compilation.LinuxThe repository is public and licensed under Apache-2.0. The README documents local installation and a prebuilt Docker image.
Nano Vllm V1Generate text offline from prompts using a local model.Linux, Self-hostedThe repository is public and identifies the project as MIT-licensed. It is designed for Linux and self-hosted use.
PyTorch C++ InferenceBuild a C++ executable that classifies an image using an exported TorchScript model.Linux, Docker, ServerThe repository is publicly accessible and identified as open source. No license is specified in the supplied repository details.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
23 October 2026
Original website title
SandAI-org/MagiCompiler · Official homepage title · retained in its source language