Skip to content
Agentmart
Submit a tool

AGENTS.md · apache/tvm

AGENTS.md from apache/tvm: 101 lines covering Repository Overview, Repository Structure, Build, Test And Lint and more.

Template by apache

IndexedApache-2.0★ 13,861
Write a review

Install

Works with Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Claude Code. Read the repository before you give any tool access to your data.

curl -fsSL https://raw.githubusercontent.com/apache/tvm/main/AGENTS.md -o AGENTS.md

Read it and adapt it to your project before use.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

The AGENTS.md file that apache/tvm (13,861 stars) keeps for coding agents. It has 101 lines in 5 sections: Repository Overview; Repository Structure; Build; Test And Lint; Coding Conventions. Use it as a model for your own project's instructions.

Use cases: prompt-engineering, code-generation

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

What's in it

An AGENTS.md file: instructions coding agents (Codex, Cursor, Copilot, Gemini CLI and others) read before working in a repo.

For
Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Claude Code
Length
101 lines
File
AGENTS.md

Sections

  1. Repository Overview
  2. Repository Structure
  3. Build
  4. Test And Lint
  5. Coding Conventions

First lines (shown under the repo's Apache-2.0 license)

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

# AGENTS.md

This file provides vendor-neutral guidance for agentic coding tools working
with Apache TVM.

## Repository Overview

Apache TVM is an open-source machine learning compiler stack. The repository
contains the C++ compiler/runtime, Python bindings, TIR/Relax IRs, scheduling
and lowering passes, target code generators, runtime integrations, tests,
documentation, and application examples.

## Repository Structure

- `include/tvm/` - public C++ headers
- `src/` - C++ implementation
- `python/tvm/` - Python package
- `tests/` - C++, Python, integration, and lint tests
- `cmake/` - CMake modules and default configuration
- `3rdparty/` - vendored dependencies and submodules
- `docs/` - documentation source
- `apps/` - application examples
- `.agents/skills/` - reusable agent workflows for this repository

## Build

Use an existing `build/` directory when present:

```bash
cmake --build build --parallel
```

For a fresh checkout, initialize submodules and configure CMake first:

```bash
git submodule update --init --recursive
mkdir -p build
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DTVM_TIRX_USE_LLVM=OFF -DTVM_TIRX_USE_CUDA=OFF
cmake --build build --parallel
```

Development should use `PYTHONPATH`, not editable installs:

```bash
export PYTHONPATH="$(pwd)/python:$(pwd)/3rdparty/tvm-tirx/python:$(pwd)/.local/python"
export TVM_TIRX_LIBRARY_PATH="$(pwd)/build/lib"
```

Do not use `pip install -e` for TVM or `tvm-ffi`; editable installs can make
one worktree silently import another worktree's code.

## Test And Lint

Run the smallest relevant test first, then broaden as needed. Common examples:

```bash
python -m pytest 3rdparty/tvm-tirx/tests/python/codegen/llvm/test_minimal.py -xvs
python -m pytest 3rdparty/tvm-tirx/tests/python/tirx/test_base.py -xvs
./build/cpptest
```

For lint validation on a pull request, run pre-commit on the files changed by
the branch instead of the whole repository:

```bash
pre-commit run --files <changed-file>...
```

Use `python -m tirx_kernels.bench_suite` in the **tirx-kernels** repo
(`tirx_kernels/bench_suite/`) when that workflow applies.

## Coding Conventions

- Follow the surrounding style before introducing new abstractions.
- Keep changes scoped to the task and avoid unrelated cleanups.
- Prefer explicit tests that show the IR or behavior being changed.
- Use Apache TVM commit tags such as `[REFACTOR][IR]`, `[FIX][TIR]`, or
  `[DOCS]` as appropriate.
- Preserve Apache license headers in new source, script, and documentation
  files when the surrounding tree uses them.

Signals

Stars
13,861
Forks
4,023
Open issues
232
Last commit (this folder)
Oct 20, 2026 (8 days ago)
Last release
Sep 29, 2026 (29 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from apache

Cite this page

AGENTS.md · apache/tvm. Agent Mart. https://agentmart.dev/templates/apache-tvm-agents-md (last updated 2026-10-24)