chore: import upstream snapshot with attribution
Lint / lint (push) Has been cancelled
CI / MacOS (push) Has been cancelled
CI / Windows (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:36:25 +08:00
commit 26446540fa
3151 changed files with 974126 additions and 0 deletions
+162
View File
@@ -0,0 +1,162 @@
# 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.
# GitHub code owners file
# This file is used as a convenient tool to map
# committers' areas of expertise and faciliate the review process.
#
# This may not be the non-comprehensive list and is meant to be
# updated over time.
# Per ASF policy, committer have global write permission.
# We normally recommend committers to shepherd code in their area of expertise.
* @apache/tvm-committers
# Order is important; the last matching pattern takes the most precedence.
# The sub modules should be ordered first by depth.
# Making sure we append new sub-module rules after exisiting modules rules.
###############################################################################
# IMPORTANT NOTE
# This file is intentionally not named CODEOWNERS to avoid getting picked up
# by GitHub's code owners -> review mechanism. For details see
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
# and https://github.com/apache/tvm-rfcs/pull/58
#
# This file is kept to allow manual inspection of who is responsible for
# different segments of the codebase.
###############################################################################
##############################
# Top-level Fallbacks
##############################
include/** @tqchen @jroesch @yzhliu @icemelon @junrushao1994 @comaniac @zhiics
src/** @tqchen @jroesch @yzhliu @icemelon @junrushao1994 @comaniac @zhiics
apps/** @tqchen @jroesch @yzhliu @icemelon @junrushao1994 @comaniac @zhiics
python/** @tqchen @jroesch @yzhliu @icemelon @junrushao1994 @comaniac @zhiics
# Thirdparty license audit
3rdparty/** @tqchen @jroesch
licenses/** @tqchen @jroesch
# JVM language
jvm/** @yzhliu
# Golang
golang/** @srkreddy1238
# WASM
web/** @tqchen @jroesch
# Docker
docker/** @areusch @leandron @jroesch
# Conda
tests/conda/** @tqchen @junrushao1994 @comaniac
# CMake
cmake/** @jroesch @tqchen @areusch @junrushao1994 @comaniac
# rust bindings
rust/** @jroesch @nhynes @nhynes
# vta
vta/** @tmoreau89 @vegaluisjose
# docs
docs/** @comaniac @junrushao1994 @tqchen @jroesch @areusch @yzhliu @merrymercy @icemelon
tutorials/** @comaniac @junrushao1994 @tqchen @jroesch @areusch @yzhliu @merrymercy @icemelon
# tests
tests/** @comaniac @junrushao1994 @tqchen @jroesch @areusch @yzhliu @merrymercy @icemelon
##############################
# Specific modules
##############################
# automation related
src/auto_scheduler/** @merrymercy @jcf94 @comaniac @junrushao1994 @vinx13 @Hzfengsy
include/tvm/auto_scheduler/** @merrymercy @jcf94 @comaniac @junrushao1994 @vinx13 @Hzfengsy
python/tvm/auto_scheduler/** @merrymercy @jcf94 @comaniac @junrushao1994 @vinx13 @Hzfengsy
python/tvm/autotvm/** @merrymercy @jcf94 @comaniac @junrushao1994 @vinx13
# node system and reflection
src/node/** @junrushao1994 @vinx13 @tqchen @jroesch @comaniac
include/tvm/node/** @junrushao1994 @vinx13 @tqchen @jroesch @comaniac
# ir: Common IR
src/ir/** @junrushao1994 @vinx13 @tqchen @jroesch @comaniac
include/tvm/ir/** @junrushao1994 @vinx13 @tqchen @jroesch @comaniac
python/tvm/ir/** @junrushao1994 @vinx13 @tqchen @jroesch @comaniac
# tir
src/tir/** @junrushao1994 @vinx13 @tqchen @kparzysz-quic @ZihengJiang @masahi @were @Hzfengsy
include/tvm/tir/** @junrushao1994 @vinx13 @tqchen @kparzysz-quic @ZihengJiang @masahi @were @Hzfengsy
python/tvm/tir/** @junrushao1994 @vinx13 @tqchen @kparzysz-quic @ZihengJiang @masahi @were @Hzfengsy
# te
src/te/** @junrushao1994 @vinx13 @tqchen @kparzysz-quic @ZihengJiang @masahi @were
include/tvm/te/** @junrushao1994 @vinx13 @tqchen @kparzysz-quic @ZihengJiang @masahi @were
python/tvm/te/** @junrushao1994 @vinx13 @tqchen @kparzysz-quic @ZihengJiang @masahi @were
# target
src/target/** @junrushao1994 @vinx13 @tqchen @kparzysz-quic @ZihengJiang @masahi
include/tvm/target/** @junrushao1994 @vinx13 @tqchen @kparzysz-quic @ZihengJiang @masahi
python/tvm/target/** @junrushao1994 @vinx13 @tqchen @kparzysz-quic @ZihengJiang @masahi
# arith: Arithmetic module and simplifiers
src/arith/** @tqchen @junrushao1994 @vinx13
include/tvm/arith/** @tqchen @junrushao1994 @vinx13
python/tvm/arith/** @tqchen @junrushao1994 @vinx13
# parser
src/parser/** @jroesch @slyubomirsky
# runtime
src/runtime/** @vinx13 @tqchen @FronzenGene @liangfu @areusch @tmoreau89 @ajtulloch @masahi @kazum @ZihengJiang @junrushao1994
include/tvm/runtime/** @vinx13 @tqchen @FronzenGene @liangfu @areusch @tmoreau89 @ajtulloch @masahi @kazum @ZihengJiang @junrushao1994
python/tvm/runtime/** @vinx13 @tqchen @FronzenGene @liangfu @areusch @tmoreau89 @ajtulloch @masahi @kazum @ZihengJiang @junrushao1994
# relay
src/relay/** @jroesch @slyubomirsky @icemelon @MarisaKirisame @ZihengJiang @yzhliu @vinx13 @mbrookhart @jwfromm @zhiics @anijain2305 @wweic @eqy @junrushao1994
include/tvm/relay/** @jroesch @slyubomirsky @icemelon @MarisaKirisame @ZihengJiang @yzhliu @vinx13 @mbrookhart @jwfromm @zhiics @anijain2305 @wweic @eqy @junrushao1994
python/tvm/relay/** @jroesch @slyubomirsky @icemelon @MarisaKirisame @ZihengJiang @yzhliu @vinx13 @mbrookhart @jwfromm @zhiics @anijain2305 @wweic @eqy @junrushao1994
# relay/qnn
src/relay/qnn/** @jwfromm @anijain2305 @ZihengJiang
inlcude/tvm/relay/qnn/** @jwfromm @anijain2305 @ZihengJiang
python/tvm/relay/qnn/** @jwfromm @anijain2305 @ZihengJiang
# relay/backend/contrib: BYOC
src/relay/backend/contrib/** @zhiics @trevor-m @comaniac @mbaret @manupa-arm
# relay/frontends
python/tvm/relay/frontend/** @jwfromm @mbrookhart @srkreddy1238 @siju-samuel @Huyuwei @hlu1 @kazum @PariksheetPinjari909
# topi: Operator definitions
src/topi/** @Laurawly @Huyuwei @kevinthesun @jwfromm @vinx13 @masahi @FronzenGene @yzhliu @mbrookhart @ZihengJiang @jcf94
include/tvm/topi/** @Laurawly @Huyuwei @kevinthesun @jwfromm @vinx13 @masahi @FronzenGene @yzhliu @mbrookhart @ZihengJiang @jcf94
python/tvm/topi/** @Laurawly @Huyuwei @kevinthesun @jwfromm @vinx13 @masahi @FronzenGene @yzhliu @mbrookhart @ZihengJiang @jcf94
# tvm/driver/
python/tvm/driver/** @leandron @jwfromm @tqchen @jroesch
# tvm/driver/tvmc
python/tvm/driver/tvmc/** @leandron @jwfromm
+32
View File
@@ -0,0 +1,32 @@
---
name: "\U0001F41B Bug report"
about: Please include a description of your environment, preferably a minimum script to reproduce the problem. Find the list of label tags at https://github.com/apache/tvm/labels.
title: "[Bug] "
labels: "needs-triage, type: bug"
---
Thanks for participating in the TVM community! We use https://discuss.tvm.apache.org/ for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking. You are always welcomed to post on the forum first :smile_cat:
Issues that are inactive for a period of time may get closed. We adopt this policy so that we won't lose track of actionable issues that may fall at the bottom of the pile. Feel free to reopen a new one if you feel there is an additional problem that needs attention when an old one gets closed.
### Expected behavior
What you were expecting
### Actual behavior
What actually happened
### Environment
Any environment details, such as: Operating System, TVM version, etc
### Steps to reproduce
Preferably a minimal script to cause the issue to occur.
### Triage
Please refer to the list of label tags [here](https://github.com/apache/tvm/labels) to find the relevant tags and add them below in a bullet format (example below).
* needs-triage
+28
View File
@@ -0,0 +1,28 @@
---
name: "\U0000274C CI Problem"
about: To help the developers act on these problems, please give us as many details of the CI failure as possible. Find the list of label tags at https://github.com/apache/tvm/labels.
title: "[CI Problem] "
labels: "needs-triage, type:ci"
---
Thanks for participating in the TVM community! We use https://discuss.tvm.apache.org/ for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking. You are always welcomed to post on the forum first :smile_cat:
Issues that are inactive for a period of time may get closed. We adopt this policy so that we won't lose track of actionable issues that may fall at the bottom of the pile. Feel free to reopen a new one if you feel there is an additional problem that needs attention when an old one gets closed.
### Branch/PR Failing
Please provide a link to the PR that has failed to run CI.
### Jenkins Link
Provide a link to the specific run that has failed.
### Flakiness
Have you seen this multiple times in this branch or in other branches?
### Triage
Please refer to the list of label tags [here](https://github.com/apache/tvm/labels) to find the relevant tags and add them below in a bullet format (example below).
* needs-triage
+5
View File
@@ -0,0 +1,5 @@
blank_issues_enabled: false # default: true
contact_links:
- name: 💬 Discourse
url: https://discuss.tvm.apache.org/
about: Thanks for participating in the TVM community! We use https://discuss.tvm.apache.org/ for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking. You are always welcomed to post on the forum first 😺
+26
View File
@@ -0,0 +1,26 @@
---
name: "\U0001F4C4 Documentation"
about: Use this template to suggest additions and changes to the documentation. Find the list of label tags at https://github.com/apache/tvm/labels.
title: "[Docs] "
labels: "needs-triage, type: doc"
---
Thanks for participating in the TVM community! We use https://discuss.tvm.apache.org/ for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking. You are always welcomed to post on the forum first :smile_cat:
Issues that are inactive for a period of time may get closed. We adopt this policy so that we won't lose track of actionable issues that may fall at the bottom of the pile. Feel free to reopen a new one if you feel there is an additional problem that needs attention when an old one gets closed.
### Documentation Title & Type
Include the title of the document (e.g. "Getting Started with TVM"), and the type of documentation (e.g. user docs, developer docs, tutorials)
### Additions/Changes Requested
If an RFC/discuss post exists, link it here.
Otherwise, specify what actions should be taken to provide additional clarity/readability/reproducibility to the document. Include code snippets from the previous documentation if applicable.
### Triage
Please refer to the list of label tags [here](https://github.com/apache/tvm/labels) to find the relevant tags and add them below in a bullet format (example below).
* needs-triage
@@ -0,0 +1,19 @@
---
name: "\U0001F527 Feature Tracking"
about: List clear, small actionable items so we can track the progress of the change. Find the list of label tags at https://github.com/apache/tvm/labels.
title: "[Tracking Issue] "
labels: "needs-triage, type:rfc-tracking"
---
Thanks for participating in the TVM community! We use https://discuss.tvm.apache.org/ for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking. You are always welcomed to post on the forum first :smile_cat:
Issues that are inactive for a period of time may get closed. We adopt this policy so that we won't lose track of actionable issues that may fall at the bottom of the pile. Feel free to reopen a new one if you feel there is an additional problem that needs attention when an old one gets closed.
### This issue is to track progress for FEATURE NAME
- [ ] P1. Title of this piece of the feature (PR link if available)
### Triage
Please refer to the list of label tags [here](https://github.com/apache/tvm/labels) to find the relevant tags and add them below in a bullet format (example below).
* needs-triage
+24
View File
@@ -0,0 +1,24 @@
---
name: "\U00002744 Flaky Test"
about: Report flaky tests, make sure to include link to CI runs, a sample failure log, and the name of the test(s). Find the list of label tags at https://github.com/apache/tvm/labels.
title: "[Flaky Test] "
labels: "needs-triage, test: flaky"
---
Thanks for participating in the TVM community! We use https://discuss.tvm.apache.org/ for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking. You are always welcomed to post on the forum first :smile_cat:
These tests were found to be flaky (intermittently failing on `main` or failed in a PR with unrelated changes). As per [the docs](https://github.com/apache/tvm/blob/main/docs/contribute/ci.rst#handling-flaky-failures), these failures will be disabled in a PR that references this issue until the test owners can fix the source of the flakiness.
### Test(s)
- `tests/python/some_file.py::the_test_name`
### Jenkins Links
- Please provide link(s) to failed CI runs. If runs are for a PR, explain why your PR did not break the test (e.g. did not touch that part of the codebase)
### Triage
Please refer to the list of label tags [here](https://github.com/apache/tvm/labels) to find the relevant tags and add them below in a bullet format (example below).
* needs-triage
@@ -0,0 +1,148 @@
# 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.
name: Build TVM Wheel
description: >
Build and test the LLVM-enabled TVM wheel for a given OS/architecture
combination using cibuildwheel.
inputs:
arch:
description: "Target architecture for cibuildwheel (e.g., x86_64, aarch64, arm64, AMD64)"
required: true
build:
description: "cibuildwheel build selector (e.g., cp310-manylinux_x86_64)"
required: true
cmake_defines:
description: "Feature CMake defines that vary by wheel (e.g. -DUSE_METAL=ON on macOS)"
required: false
default: ""
include_cuda_runtime:
description: "Set to 1 to build and inject the CUDA runtime library (Linux only)"
required: false
default: "0"
runs:
using: "composite"
steps:
# Single source of truth for the LLVM toolchain version, shared by the cache
# key and the conda install steps below.
- name: Set LLVM version
shell: bash
run: echo "LLVM_VERSION=22.1.0" >> "$GITHUB_ENV"
- name: Prepare LLVM cache path (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
set -eux
sudo mkdir -p /opt/llvm
sudo chown -R "$(whoami)" /opt/llvm
# ---- Cache LLVM prefix ----
- name: Cache LLVM
uses: actions/cache@v5.0.5
id: llvm-cache
with:
path: ${{ runner.os == 'Windows' && 'C:/opt/llvm' || '/opt/llvm' }}
key: tvm-wheel-llvm-${{ env.LLVM_VERSION }}-${{ runner.os }}-${{ inputs.arch }}-v6
# ---- Install LLVM via conda (cache miss only) ----
- name: Setup conda
if: steps.llvm-cache.outputs.cache-hit != 'true'
uses: conda-incubator/setup-miniconda@v4.0.1
continue-on-error: true
id: conda1
with:
miniforge-version: latest
conda-remove-defaults: true
- name: Setup conda (retry with tar.bz2)
if: steps.llvm-cache.outputs.cache-hit != 'true' && steps.conda1.outcome == 'failure'
uses: conda-incubator/setup-miniconda@v4.0.1
with:
miniforge-version: latest
use-only-tar-bz2: true
conda-remove-defaults: true
- name: Install LLVM (Unix)
if: steps.llvm-cache.outputs.cache-hit != 'true' && runner.os != 'Windows'
shell: bash -l {0}
run: |
set -eux
if [[ "${RUNNER_OS}" == "Linux" ]]; then
sudo mkdir -p /opt/llvm
sudo chown -R "$(whoami)" /opt/llvm
fi
conda create -q -p /opt/llvm -c conda-forge \
"llvmdev=${LLVM_VERSION}" "clangdev=${LLVM_VERSION}" "compiler-rt=${LLVM_VERSION}" zlib zstd-static libxml2-devel \
-y
- name: Install LLVM (Windows)
if: steps.llvm-cache.outputs.cache-hit != 'true' && runner.os == 'Windows'
shell: cmd /C call {0}
run: |
call conda create -q -p C:\opt\llvm -c conda-forge llvmdev=%LLVM_VERSION% zlib zstd-static libxml2-devel -y
# The {project} placeholder is not expanded inside CIBW_ENVIRONMENT values, so
# compute the forward-slash host path here (the Windows analog of the Linux
# /project hardcode).
- name: Compute CUDA sidecar path (Windows)
if: runner.os == 'Windows' && inputs.include_cuda_runtime == '1'
shell: bash
run: echo "TVM_CUDA_EXTRA_LIB=$(cygpath -m "$(pwd)")/build-wheel-cuda/lib/tvm_runtime_cuda.dll" >> "$GITHUB_ENV"
# ---- Build and test wheels ----
- name: Build and test wheels
uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0
with:
package-dir: .
output-dir: wheelhouse
env:
CIBW_BUILD: ${{ inputs.build }}
CIBW_ARCHS_LINUX: ${{ inputs.arch }}
CIBW_ARCHS_MACOS: ${{ inputs.arch }}
CIBW_ARCHS_WINDOWS: ${{ inputs.arch }}
# Linux builds run in cibuildwheel's default manylinux_2_28 container;
# bind-mount the cached LLVM prefix into it. Ignored on macOS/Windows,
# which build without a container.
CIBW_CONTAINER_ENGINE: "docker; create_args: --volume /opt/llvm:/opt/llvm:ro"
# Each per-OS block carries the toolchain location (conda LLVM prefix +
# llvm-config path), the universal static-link policy (USE_LLVM --link-static
# and ZLIB_USE_STATIC_LIBS), and the CUDA sidecar. Feature defines that vary by
# wheel (e.g. USE_METAL on macOS) come from the matrix via inputs.cmake_defines.
# One explicit block per build platform (macOS / Linux / Windows); cibuildwheel
# env overrides replace rather than merge, so there is no shared base block.
CIBW_ENVIRONMENT_MACOS: >-
CMAKE_PREFIX_PATH="/opt/llvm"
CMAKE_ARGS="-DUSE_LLVM='/opt/llvm/bin/llvm-config --link-static' -DZLIB_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=/opt/llvm ${{ inputs.cmake_defines }}"
CIBW_ENVIRONMENT_LINUX: >-
CMAKE_PREFIX_PATH="/opt/llvm"
LIBRARY_PATH="/opt/llvm/lib"
CMAKE_ARGS="-DUSE_LLVM='/opt/llvm/bin/llvm-config --link-static' -DZLIB_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=/opt/llvm ${{ inputs.cmake_defines }} -DTVM_PACKAGE_EXTRA_LIBS=/project/build-wheel-cuda/lib/libtvm_runtime_cuda.so"
CIBW_ENVIRONMENT_WINDOWS: >-
CMAKE_PREFIX_PATH="C:/opt/llvm/Library"
PATH="C:/opt/llvm/Library/bin;$PATH"
CMAKE_ARGS="-DUSE_LLVM='C:/opt/llvm/Library/bin/llvm-config.exe --link-static' -DZLIB_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=C:/opt/llvm/Library ${{ inputs.cmake_defines }} -DTVM_PACKAGE_EXTRA_LIBS=${{ env.TVM_CUDA_EXTRA_LIB }}"
# Turns the wheel-specific assertions in
# tests/python/all-platform-minimal-test/test_validate_runtime_library.py
# ON (they skip unless these are set). Every published wheel is LLVM-enabled,
# so TVM_WHEEL_EXPECT_LLVM is always "1"; the CUDA runtime is only bundled on
# the CUDA wheels, so TVM_WHEEL_EXPECT_CUDA_RUNTIME is "0" for CPU wheels.
CIBW_TEST_ENVIRONMENT: >-
TVM_WHEEL_EXPECT_LLVM="1"
TVM_WHEEL_EXPECT_CUDA_RUNTIME="${{ inputs.include_cuda_runtime }}"
@@ -0,0 +1,40 @@
# 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.
name: Detect Environment Variables
description: Detects environment variables such as CPU count and sets them as outputs.
runs:
using: "composite"
steps:
- name: Run Python to detect environment variables
shell: python
id: detect
run: |
import multiprocessing, os
output_file = open(os.environ.get("GITHUB_OUTPUT"), "a")
def write_env_var(name, value):
output_file.write(f"{name}={value}\n")
print(f"Detected environment variable: {name}={value}")
write_env_var("cpu_count", multiprocessing.cpu_count())
outputs:
cpu_count:
description: "The number of CPU cores"
value: ${{ steps.detect.outputs.cpu_count }}
+47
View File
@@ -0,0 +1,47 @@
name: Setup TVM CI environment
description: Set up the cached conda build environment and install tvm-ffi.
runs:
using: "composite"
steps:
- uses: actions/cache@v5.0.5
env:
CACHE_NUMBER: 2
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/scripts/package/build-environment.yaml') }}
- uses: conda-incubator/setup-miniconda@v4.0.1
continue-on-error: true
id: conda1
with:
activate-environment: tvm-build
channel-priority: strict
environment-file: ci/scripts/package/build-environment.yaml
auto-activate-base: false
miniforge-version: latest
python-version: "3.10"
condarc-file: tests/conda/condarc
conda-remove-defaults: true
- uses: conda-incubator/setup-miniconda@v4.0.1
if: steps.conda1.outcome == 'failure'
with:
activate-environment: tvm-build
channel-priority: strict
environment-file: ci/scripts/package/build-environment.yaml
auto-activate-base: false
miniforge-version: latest
use-only-tar-bz2: true
python-version: "3.10"
condarc-file: tests/conda/condarc
conda-remove-defaults: true
- name: Conda info
shell: pwsh
run: |
mamba info
mamba list
mamba info --envs
mamba list --name base
- name: Install tvm-ffi pip package
shell: bash -l {0}
run: |
pip install -v ./3rdparty/tvm-ffi
+15
View File
@@ -0,0 +1,15 @@
# See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#about-the-dependabotyml-file
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 0
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 0
+41
View File
@@ -0,0 +1,41 @@
# 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.
name: Lint
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: Lint-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
fetch-tags: true
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
+119
View File
@@ -0,0 +1,119 @@
# 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.
# GH actions.
# We use it to cover windows and mac builds
# Jenkins is still the primary CI
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: CI-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
MacOS:
if: ${{ github.repository == 'apache/tvm' }}
runs-on: macOS-latest
steps:
- uses: actions/checkout@v6.0.2
with:
submodules: 'recursive'
- name: Set up environment
uses: ./.github/actions/setup
- name: Detect environment variables
uses: ./.github/actions/detect-env-vars
id: env_vars
- name: Build TVM wheel
shell: bash -l {0}
env:
CMAKE_BUILD_PARALLEL_LEVEL: ${{ steps.env_vars.outputs.cpu_count }}
run: |
pip install scikit-build-core
export CMAKE_ARGS="-DUSE_LLVM=ON -DBUILD_TESTING=OFF"
pip wheel --no-deps -w dist . -v
- name: Install TVM from wheel
shell: bash -l {0}
run: |
export TVM_FFI_VERSION="$(python -c 'from importlib.metadata import version; print(version("apache-tvm-ffi"))')"
pip install ml_dtypes
# Keep the source-matched tvm-ffi installed by the setup action.
pip install --no-deps dist/*.whl
python - <<'PY'
import os
from importlib.metadata import requires, version
assert version("apache-tvm-ffi") == os.environ["TVM_FFI_VERSION"]
assert "apache-tvm-ffi>=0.1.13" in requires("apache-tvm")
PY
- name: Test
shell: bash -l {0}
run: >-
python -m pytest -v tests/python/all-platform-minimal-test
- name: Minimal Metal Compile-Only
shell: bash -l {0}
run: |
python -m pytest -v -s 'tests/python/codegen/test_gpu_codegen_allreduce.py::test_allreduce_sum_compile'
python -m pytest -v -s 'tests/python/codegen/test_target_codegen_metal.py::test_func_with_trailing_pod_params'
- name: Minimal Metal Compile-and-Run
shell: bash -l {0}
run: |
python -m pytest -v -s 'tests/python/codegen/test_target_codegen_metal.py'
python -m pytest -v -s 'tests/python/codegen/test_target_codegen_gpu_common.py'
python -m pytest -v -s 'tests/python/codegen/test_gpu_codegen_allreduce.py::test_allreduce_sum[dims0-metal]'
Windows:
if: ${{ github.repository == 'apache/tvm' }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v6.0.2
with:
submodules: 'recursive'
- name: Set up environment
uses: ./.github/actions/setup
- name: Detect environment variables
uses: ./.github/actions/detect-env-vars
id: env_vars
- name: Install TVM
shell: cmd /C call {0}
env:
CMAKE_BUILD_PARALLEL_LEVEL: ${{ steps.env_vars.outputs.cpu_count }}
run: |
pip install scikit-build-core
set CMAKE_ARGS=-DUSE_LLVM=ON -DBUILD_TESTING=OFF
pip install --no-deps . -v
- name: Install test dependencies
shell: cmd /C call {0}
run: |
pip install psutil cloudpickle ml_dtypes numpy packaging scipy tornado typing_extensions
- name: Test
shell: cmd /C call {0}
run: >-
python -m pytest -v tests/python/all-platform-minimal-test
@@ -0,0 +1,24 @@
name: Nightly Docker Update
on:
workflow_dispatch:
concurrency:
group: nightly-docker-update
cancel-in-progress: true
jobs:
open_update_pr:
permissions:
contents: write
pull-requests: write
if: github.repository == 'apache/tvm'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- name: Open PR to update Docker images
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eux
python ci/scripts/jenkins/open_docker_update_pr.py
+219
View File
@@ -0,0 +1,219 @@
# 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.
name: Publish TVM wheels
on:
workflow_dispatch:
inputs:
tag:
description: "Tag, branch, or SHA to build"
required: true
type: string
publish_repository:
description: "Where to publish after the wheel build succeeds"
required: true
default: "none"
type: choice
options:
- none
- pypi
permissions:
contents: read
# CI runners are ephemeral, so pip's HTTP cache buys nothing and a stale
# preinstalled cache (e.g. on the macOS image) only produces noisy
# "Cache entry deserialization failed" warnings. Disable it everywhere.
env:
PIP_NO_CACHE_DIR: "1"
jobs:
# Build the CUDA runtime sidecar once per arch and upload it as an artifact that
# build_wheels bundles. The Linux legs build inside the official manylinux_2_28
# CUDA image (CUDA toolkit preinstalled, see pypa/manylinux) -- the same glibc
# baseline cibuildwheel targets for the wheel -- so the sidecar stays
# ABI-compatible with the wheel's libtvm_runtime.so regardless of the exact tag.
build_cuda_runtime:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
include:
- name: "CUDA runtime sidecar (Linux x86_64, manylinux_2_28)"
os: ubuntu-latest
container: quay.io/manylinux_cuda/manylinux_2_28_x86_64_cuda13_1:latest
arch: x86_64
script: ci/scripts/package/manylinux_build_libtvm_runtime_cuda.sh
lib: build-wheel-cuda/lib/libtvm_runtime_cuda.so
- name: "CUDA runtime sidecar (Linux aarch64, manylinux_2_28)"
os: ubuntu-24.04-arm
container: quay.io/manylinux_cuda/manylinux_2_28_aarch64_cuda13_1:latest
arch: aarch64
script: ci/scripts/package/manylinux_build_libtvm_runtime_cuda.sh
lib: build-wheel-cuda/lib/libtvm_runtime_cuda.so
- name: "CUDA runtime sidecar (Windows AMD64)"
os: windows-2022
container: ""
arch: AMD64
script: ci/scripts/package/windows_build_libtvm_runtime_cuda.bat
lib: build-wheel-cuda/lib/tvm_runtime_cuda.dll
steps:
# The containerized Linux legs check out as root; mark the tree safe so git
# (submodule init in checkout) does not bail on "dubious ownership".
- name: Mark workspace safe for git
if: runner.os == 'Linux'
shell: bash
run: git config --global --add safe.directory '*'
- name: Checkout source
uses: actions/checkout@v6.0.2
with:
ref: ${{ inputs.tag }}
submodules: recursive
fetch-depth: 1
fetch-tags: true
# Windows has no manylinux interpreter; the script's pip install needs one.
- name: Set up Python (Windows host)
if: runner.os == 'Windows'
uses: actions/setup-python@v6.2.0
with:
python-version: "3.10"
- name: Build CUDA runtime sidecar (Unix)
if: runner.os != 'Windows'
shell: bash
run: bash ${{ matrix.script }}
- name: Build CUDA runtime sidecar (Windows)
if: runner.os == 'Windows'
shell: cmd
run: call ${{ matrix.script }}
- name: Upload CUDA runtime sidecar
uses: actions/upload-artifact@v7.0.1
with:
name: tvm-cuda-runtime-${{ matrix.arch }}
path: ${{ matrix.lib }}
if-no-files-found: error
build_wheels:
name: ${{ matrix.name }}
# All-or-nothing: a failed sidecar leg blocks the whole wheel matrix (a publish
# needs the complete 4-wheel set anyway).
needs: [build_cuda_runtime]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: "Linux x86_64 wheel with CUDA runtime (manylinux_2_28)"
os: ubuntu-latest
arch: x86_64
build: cp310-manylinux_x86_64
include_cuda_runtime: "1"
artifact_suffix: linux-x86_64-manylinux_2_28
- name: "Linux aarch64 wheel with CUDA runtime (manylinux_2_28)"
os: ubuntu-24.04-arm
arch: aarch64
build: cp310-manylinux_aarch64
include_cuda_runtime: "1"
artifact_suffix: linux-aarch64-manylinux_2_28
- name: "macOS arm64 wheel with Metal"
os: macos-14
arch: arm64
build: cp310-macosx_arm64
include_cuda_runtime: "0"
artifact_suffix: macos-arm64
cmake_defines: "-DUSE_METAL=ON"
- name: "Windows AMD64 wheel with CUDA runtime"
os: windows-2022
arch: AMD64
build: cp310-win_amd64
include_cuda_runtime: "1"
artifact_suffix: windows-amd64
steps:
- name: Checkout source
uses: actions/checkout@v6.0.2
with:
ref: ${{ inputs.tag }}
submodules: recursive
# Full history + tags so setuptools_scm can derive the wheel version from
# the most recent Git tag during the build (shallow clones break it).
fetch-depth: 0
fetch-tags: true
# Land the sidecar where -DTVM_PACKAGE_EXTRA_LIBS / cibuildwheel's /project
# mount expects it. Skipped on CPU-only rows (macOS).
- name: Download CUDA runtime sidecar
if: ${{ matrix.include_cuda_runtime == '1' }}
uses: actions/download-artifact@v8.0.1
with:
name: tvm-cuda-runtime-${{ matrix.arch }}
path: build-wheel-cuda/lib
- name: Build TVM wheel
uses: ./.github/actions/build-wheel-for-publish
with:
arch: ${{ matrix.arch }}
build: ${{ matrix.build }}
cmake_defines: ${{ matrix.cmake_defines }}
include_cuda_runtime: ${{ matrix.include_cuda_runtime }}
- name: Upload wheel artifact
uses: actions/upload-artifact@v7.0.1
with:
name: tvm-wheel-${{ matrix.artifact_suffix }}
path: wheelhouse/*.whl
if-no-files-found: error
upload_pypi:
name: Upload package distributions
needs: [build_wheels]
if: ${{ inputs.publish_repository != 'none' }}
runs-on: ubuntu-latest
environment: ${{ inputs.publish_repository }}
permissions:
id-token: write
attestations: write
steps:
- uses: actions/download-artifact@v8.0.1
with:
pattern: tvm-wheel-*
path: dist
merge-multiple: true
# Print wheel sizes for visibility only. We do not fail on the PyPI 100 MB
# limit here -- the publish step's upload would surface that error directly.
- name: Print wheel sizes
shell: bash
run: ls -alh dist/*.whl
- name: Generate artifact attestation for wheels
uses: actions/attest-build-provenance@v4.1.0
with:
subject-path: dist/*
- name: Publish package distributions to PyPI
if: ${{ inputs.publish_repository == 'pypi' }}
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
attestations: true
verbose: true
+31
View File
@@ -0,0 +1,31 @@
name: tvm-bot
on:
issue_comment:
types: [created]
concurrency:
group: merge-${{ github.event.issue.number }}
cancel-in-progress: true
jobs:
run-tvm-bot:
permissions:
contents: write
issues: write
pull-requests: write
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '@tvm-bot ') && github.repository == 'apache/tvm' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- name: Run tvm-bot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_ACTIONS_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }}
TVM_BOT_JENKINS_TOKEN: ${{ secrets.TVM_BOT_JENKINS_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
ISSUE_COMMENT: ${{ toJson(github.event.comment) }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
set -eux
python ci/scripts/github/github_tvmbot.py --pr "$PR_NUMBER" --run-url "$RUN_URL" --trigger-comment-json "$ISSUE_COMMENT"