Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b3c8849
[Fix] nn.attention support dynamic batch_size (#19779)
flashmouse Jun 15, 2026
1c1afe3
[Relax][ONNX] Make ReduceMax/ReduceMin NaN propagation order-independ…
cchung100m Jun 15, 2026
668d119
[Docs][CI] Bump tlcpack-sphinx-addon to restore search result summari…
tlopex Jun 15, 2026
1086fc9
[REFACTOR][IR] Cleanup IR naming utilities (#19781)
tqchen Jun 15, 2026
4066127
[CUDA] Narrow the cuda extra from cuda-python to cuda-bindings (#19784)
tlopex Jun 15, 2026
3ea565b
[AGENT] Migrate agent instructions to vendor-neutral layout (#19783)
tqchen Jun 15, 2026
b684868
[Tests] Modernize test gating (#19777)
tlopex Jun 15, 2026
694dacb
[TIRX][CUDA] Framework support for FA4, CLC intrinsics, and nvfp4 tcg…
spectrometerHBH Jun 16, 2026
bce6ebc
[Relax][TensorRT] Update TensorRT runtime to 10 (#19789)
tlopex Jun 16, 2026
e8e9478
[Tests] Make TargetCreation.DeduplicateKeys host-agnostic on AArch64 …
tlopex Jun 16, 2026
00813d6
[Tests] Replace remaining requires_* helpers with standard pytest (#1…
tlopex Jun 16, 2026
8ede60c
[TIRx][RISC-V] Use scalable RVV loops for fixed vectorize (#19776)
ZephyrLi-pro Jun 16, 2026
c4c737a
[Docs] Modernize test-gating documentation (#19788)
tlopex Jun 16, 2026
beb6511
[Web] Destroy GPUDevice once on buffer creation error (#19790)
guan404ming Jun 16, 2026
a7864af
[REFACTOR] Phase out unused queue and rang license entries (#19794)
tqchen Jun 16, 2026
5388ea3
[REFACTOR][HEXAGON] Phase out Hexagon app and test wrappers (#19796)
tqchen Jun 16, 2026
b6c73cd
[CI] Pin GitHub Actions to SHA for ASF INFRA compliance (#19793)
guan404ming Jun 16, 2026
a335a14
[Web] use singular requestFileHandle() instead of requestFileHandles(…
tomayac Jun 16, 2026
b1b95b1
[REFACTOR][IR] Simplify CallingConv attribute access (#19799)
tqchen Jun 16, 2026
9112a17
[CI] Remove Jenkins PR linter step (#19798)
tqchen Jun 16, 2026
d4dcb70
[Relax][Frontend][TFLite] Add support for FFT/complex operators: REAL…
fnhirwa Jun 16, 2026
297f944
[REFACTOR][TIRX] Add IntImm common scalar ctor and streamline MakeCon…
tqchen Jun 16, 2026
0815e00
[Tests][Refactor] Remove unused testing helpers (#19800)
tlopex Jun 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,18 @@ while [[ $# -gt 0 ]]; do
--interval) INTERVAL="$2"; shift 2 ;;
--log) LOG="$2"; shift 2 ;;
-h|--help)
sed -n '2,12p' "$0" | sed 's/^# \{0,1\}//'
cat <<'EOF'
Watch a single GPU for foreign processes (anyone other than the current
user) appearing during a long-running test. Intended companion to
`/tir-test`: leave this running in a side terminal while pytest runs, and
it will alert if someone else lands on the same GPU.

Usage:
monitor_gpu.sh # uses $CUDA_VISIBLE_DEVICES, defaults to 0
monitor_gpu.sh --gpu 3 # watch GPU 3
monitor_gpu.sh --gpu 3 --interval 2 # poll every 2 seconds
monitor_gpu.sh --log /tmp/gpu.log # also tee to a log file
EOF
exit 0 ;;
*) echo "unknown arg: $1" >&2; exit 2 ;;
esac
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ Build TVM from the current worktree.

1. Check that `build/` directory exists. If not, run initial setup:
```bash
mkdir -p build && cd build && cmake .. && make -j$(nproc)
mkdir -p build
cmake -S . -B build
cmake --build build --parallel
```

2. If `build/` already exists, run incremental build:
```bash
cmake --build build -j$(nproc)
cmake --build build --parallel
```

3. Report success/failure and build time.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Run the full TIRX test suite.
2. Start the GPU monitor in the background so we can detect if anyone else lands on the same GPU mid-run:
```bash
GPU_LOG="/tmp/tir_test_gpu_${CUDA_VISIBLE_DEVICES}.log"
bash .claude/scripts/monitor_gpu.sh --gpu "$CUDA_VISIBLE_DEVICES" --interval 5 --log "$GPU_LOG" &
bash .agents/scripts/monitor_gpu.sh --gpu "$CUDA_VISIBLE_DEVICES" --interval 5 --log "$GPU_LOG" &
MON_PID=$!
trap 'kill $MON_PID 2>/dev/null' EXIT
```

3. Run the full test suite with xdist parallelism:
```bash
pytest tests/python/tirx/ -n 16
pytest tests/python/tirx/ -n auto
```

4. Stop the monitor and check for foreign GPU usage during the run:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build-wheel-for-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ runs:

# ---- Build and test wheels ----
- name: Build and test wheels
uses: pypa/cibuildwheel@v4.1.0
uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0
with:
package-dir: .
output-dir: wheelhouse
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
with:
fetch-depth: 0
fetch-tags: true
- uses: pre-commit/action@v3.0.1
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
2 changes: 1 addition & 1 deletion .github/workflows/publish_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ jobs:

- name: Publish package distributions to PyPI
if: ${{ inputs.publish_repository == 'pypi' }}
uses: pypa/gh-action-pypi-publish@v1.13.0
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
attestations: true
verbose: true
99 changes: 99 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<!--
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
cp cmake/config.cmake build/config.cmake
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build --parallel
```

Development should use `PYTHONPATH`, not editable installs:

```bash
export PYTHONPATH="$(pwd)/python:$(pwd)/.local/python"
```

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 tests/python/all-platform-minimal-test/ -xvs
python -m pytest tests/python/tir-base/test_tir_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 `.agents/skills/tir-build`, `.agents/skills/tir-test`, and
`.agents/skills/tir-bench` when their workflows apply.

## 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.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ tvm_option(TVM_BUILD_PYTHON_MODULE "Build Python module with scikit-build-core"
# include directories
include_directories(${CMAKE_INCLUDE_PATH})
include_directories("include")
include_directories(SYSTEM ${RANG_PATH})
include_directories(SYSTEM ${COMPILER_RT_PATH})

# initial variables
Expand Down
14 changes: 6 additions & 8 deletions apps/cpp_rpc/rpc_env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ std::string RPCEnv::GetPath(const std::string& file_name) const {
*/
void RPCEnv::CleanUp() const {
CleanDir(base_);
if (!CheckPath(base_))
return;
if (!CheckPath(base_)) return;
const int ret = rmdir(base_.c_str());
if (ret != 0) {
LOG(WARNING) << "Remove directory " << base_ << " failed";
Expand Down Expand Up @@ -325,11 +324,11 @@ std::string BuildSharedLibrary(std::string file) {
*/
bool CheckPath(const std::string& pathname) {
#if defined(_WIN32)
DWORD attribs = GetFileAttributesA(pathname.c_str());
return (attribs != INVALID_FILE_ATTRIBUTES);
DWORD attribs = GetFileAttributesA(pathname.c_str());
return (attribs != INVALID_FILE_ATTRIBUTES);
#else
struct stat info;
return (stat(pathname.c_str(), &info) == 0);
struct stat info;
return (stat(pathname.c_str(), &info) == 0);
#endif
}

Expand All @@ -338,8 +337,7 @@ bool CheckPath(const std::string& pathname) {
* \param dirname The name of the directory
*/
void CleanDir(const std::string& dirname) {
if (!CheckPath(dirname))
return;
if (!CheckPath(dirname)) return;
auto files = ListDir(dirname);
for (const auto& filename : files) {
std::string file_path = dirname + "/";
Expand Down
5 changes: 2 additions & 3 deletions apps/cpp_rpc/rpc_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class RPCServer {
<< ", status = " << status_second;
} else if (finished_first == worker_pid) {
LOG(INFO) << "Child pid=" << worker_pid << " finished"
<< ", status = "<< status_first;
<< ", status = " << status_first;
}
} else {
auto pid = fork();
Expand Down Expand Up @@ -334,8 +334,7 @@ class RPCServer {
RPCServerLoop(int(sock.sockfd));
const auto e_time = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> elapsed = e_time - s_time;
LOG(INFO) << "Finished serving " << addr.AsString()
<< " after " << elapsed.count() << " sec";
LOG(INFO) << "Finished serving " << addr.AsString() << " after " << elapsed.count() << " sec";
env.CleanUp();
}

Expand Down
Loading
Loading