Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
67ccff7
kernel library guide
cyx-6 Oct 18, 2025
57d6c03
fix lint
cyx-6 Oct 18, 2025
58ce14c
add licence
cyx-6 Oct 18, 2025
f18fec2
add index
cyx-6 Oct 18, 2025
c2a5a17
upd
cyx-6 Oct 20, 2025
aa3c715
fix
cyx-6 Oct 20, 2025
f8b8b92
fix
cyx-6 Oct 20, 2025
507d17e
upd
cyx-6 Oct 20, 2025
d87c16a
add orcjit
yaoyaoding Nov 9, 2025
501b635
add more tests
yaoyaoding Nov 10, 2025
6ce56a1
fix tests
yaoyaoding Nov 10, 2025
d27a5b0
wip
yaoyaoding Nov 10, 2025
cf2da5d
fix
yaoyaoding Nov 10, 2025
76d13d5
fix cmakelists.txt
yaoyaoding Nov 10, 2025
b57756d
fix
yaoyaoding Nov 10, 2025
331404b
fix tests on macos
yaoyaoding Nov 10, 2025
c15f037
Update addons/tvm-ffi-orcjit/pyproject.toml
yaoyaoding Nov 10, 2025
1bc971c
Update addons/tvm-ffi-orcjit/examples/quick-start/compile.sh
yaoyaoding Nov 10, 2025
c9dc320
Update addons/tvm-ffi-orcjit/README.md
yaoyaoding Nov 10, 2025
b855a9e
wip
yaoyaoding Nov 11, 2025
0dfc2d1
use the right way to define object
yaoyaoding Nov 11, 2025
5af6c77
move include to src
yaoyaoding Nov 11, 2025
b9eb2aa
update cmakelists.txt
yaoyaoding Nov 11, 2025
d161749
Merge commit '7f3f8726156ab6e33f781562afafd9c6f219551f' into guide
cyx-6 Nov 14, 2025
b78c6db
refactor
cyx-6 Nov 15, 2025
df71054
test with empty commit
yaoyaoding Nov 17, 2025
00e6bdb
add more links; some modifications
yaoyaoding Nov 17, 2025
3e968b2
fix
cyx-6 Nov 18, 2025
3e36d6d
upd
cyx-6 Nov 18, 2025
2d6c522
upd
cyx-6 Nov 18, 2025
b6eae62
fix
cyx-6 Nov 18, 2025
5f24604
upd
cyx-6 Nov 18, 2025
264dfad
upd
cyx-6 Nov 18, 2025
f961dd3
Merge commit '264dfad84c1ce172ac8e6f430f6ddeb013eb1224' into orcjit
cyx-6 Nov 19, 2025
3d98e3b
wip
cyx-6 Nov 19, 2025
876213f
fix
cyx-6 Nov 19, 2025
90933d7
wip
cyx-6 Nov 20, 2025
6d7061b
upd
cyx-6 Nov 20, 2025
4a5793e
Merge commit 'db53ce4f4f8f2afc9cfd8070b5c7b092dcd04176' into orcjit
cyx-6 Nov 20, 2025
c831c7a
upd
cyx-6 Nov 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 164 additions & 0 deletions .github/workflows/orcjit-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# 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-FFI-OrcJIT

on:
workflow_dispatch:
inputs:
branch:
description: "Branch or tag to publish (manual run)"
required: true
default: "main"
pypi_repository:
description: "PyPI repository (pypi or testpypi)"
required: true
default: "testpypi"
type: choice
options:
- pypi
- testpypi

jobs:
build_wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-latest, arch: x86_64, linux_image: manylinux2014}
- {os: ubuntu-latest, arch: x86_64, linux_image: manylinux_2_28}
- {os: ubuntu-24.04-arm, arch: aarch64, linux_image: manylinux2014}
- {os: ubuntu-24.04-arm, arch: aarch64, linux_image: manylinux_2_28}
- {os: macos-14, arch: arm64, linux_image: ""}

steps:
# Special handling for macOS arm64 + python 3.8/3.9
- uses: actions/setup-python@v5
with:
python-version: 3.9
if: runner.os == 'macOS' && runner.arch == 'ARM64'

- uses: astral-sh/setup-uv@v6
if: matrix.os != 'macos-14'

- uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
submodules: recursive
fetch-depth: 0
fetch-tags: true

- name: Print current commit
run: git log -1 --oneline

- name: Install LLVM (Linux)
if: runner.os == 'Linux'
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
sudo apt-get install -y llvm-18-dev

- name: Install LLVM (macOS)
if: runner.os == 'macOS'
run: |
brew install llvm@18
echo "LLVM_DIR=$(brew --prefix llvm@18)" >> $GITHUB_ENV

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.linux_image }}
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.linux_image }}
CIBW_BUILD_VERBOSITY: 1
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-*
CIBW_SKIP: "*-musllinux_*"
# Install LLVM in the manylinux container
CIBW_BEFORE_ALL_LINUX: |
yum install -y wget
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz
tar -xf clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz
export PATH="$PWD/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin:$PATH"
export LLVM_DIR="$PWD/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04"
# Placeholder: may need to install tvm-ffi first
CIBW_BEFORE_BUILD: |
pip install apache-tvm-ffi || echo "apache-tvm-ffi not yet published"

with:
package-dir: addons/tvm-ffi-orcjit
output-dir: wheelhouse

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ matrix.arch }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
submodules: recursive
fetch-depth: 0
fetch-tags: true

- uses: astral-sh/setup-uv@v6

- name: Build sdist
working-directory: addons/tvm-ffi-orcjit
run: pipx run build --sdist --outdir dist .

- name: Check metadata
working-directory: addons/tvm-ffi-orcjit
run: pipx run twine check dist/*

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: addons/tvm-ffi-orcjit/dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
attestations: write
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- name: Generate artifact attestation for sdist and wheels
uses: actions/attest-build-provenance@v1
with:
subject-path: dist/*

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
verbose: true
repository-url: ${{ inputs.pypi_repository == 'testpypi' && 'https://test.pypi.org/legacy/' || '' }}
104 changes: 104 additions & 0 deletions .github/workflows/orcjit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# 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: TVM-FFI-OrcJIT CI Tests

on:
push:
branches:
- main
- dev
- orcjit
paths:
- 'addons/tvm-ffi-orcjit/**'
- '.github/workflows/tvm-ffi-orcjit/ci_test.yml'
pull_request:
paths:
- 'addons/tvm-ffi-orcjit/**'
- '.github/workflows/tvm-ffi-orcjit/ci_test.yml'
workflow_dispatch:

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v5
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install LLVM (Ubuntu)
if: runner.os == 'Linux'
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
sudo apt-get install -y llvm-18-dev clang-18
echo "CC=clang-18" >> $GITHUB_ENV
echo "CXX=clang++-18" >> $GITHUB_ENV

- name: Install LLVM (macOS)
if: runner.os == 'macOS'
run: |
brew install llvm@18
echo "LLVM_DIR=$(brew --prefix llvm@18)" >> $GITHUB_ENV
echo "CC=$(brew --prefix llvm@18)/bin/clang" >> $GITHUB_ENV
echo "CXX=$(brew --prefix llvm@18)/bin/clang++" >> $GITHUB_ENV

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Install tvm-ffi (core package)
run: |
uv pip install -e . --system

- name: Build and install tvm-ffi-orcjit
working-directory: addons/tvm-ffi-orcjit
run: |
uv pip install -e . --system

- name: Install test dependencies
run: |
uv pip install pytest --system

- name: Build test object files
working-directory: addons/tvm-ffi-orcjit/tests
run: |
cmake -B build
cmake --build build

- name: Run tests
working-directory: addons/tvm-ffi-orcjit
run: |
pytest tests/ -v

- name: Run example
working-directory: addons/tvm-ffi-orcjit/examples/quick-start
run: |
cmake -B build
cmake --build build
python run.py
104 changes: 104 additions & 0 deletions .github/workflows/tvm-ffi-orcjit/ci_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# 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: TVM-FFI-OrcJIT CI Tests

on:
push:
branches:
- main
- dev
- orcjit
paths:
- 'addons/tvm-ffi-orcjit/**'
- '.github/workflows/tvm-ffi-orcjit/ci_test.yml'
pull_request:
paths:
- 'addons/tvm-ffi-orcjit/**'
- '.github/workflows/tvm-ffi-orcjit/ci_test.yml'
workflow_dispatch:

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v5
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install LLVM (Ubuntu)
if: runner.os == 'Linux'
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
sudo apt-get install -y llvm-18-dev clang-18
echo "CC=clang-18" >> $GITHUB_ENV
echo "CXX=clang++-18" >> $GITHUB_ENV

- name: Install LLVM (macOS)
if: runner.os == 'macOS'
run: |
brew install llvm@18
echo "LLVM_DIR=$(brew --prefix llvm@18)" >> $GITHUB_ENV
echo "CC=$(brew --prefix llvm@18)/bin/clang" >> $GITHUB_ENV
echo "CXX=$(brew --prefix llvm@18)/bin/clang++" >> $GITHUB_ENV

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Install tvm-ffi (core package)
run: |
uv pip install -e . --system

- name: Build and install tvm-ffi-orcjit
working-directory: addons/tvm-ffi-orcjit
run: |
uv pip install -e . --system

- name: Install test dependencies
run: |
uv pip install pytest --system

- name: Build test objects
working-directory: addons/tvm-ffi-orcjit/tests
run: |
cmake -B build
cmake --build build

- name: Run tests
working-directory: addons/tvm-ffi-orcjit
run: |
pytest tests/ -v

- name: Run example
working-directory: addons/tvm-ffi-orcjit/examples/quick-start
run: |
cmake -B build
cmake --build build
python run.py
Loading
Loading