chore: import upstream snapshot with attribution
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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"
|
||||
Reference in New Issue
Block a user