8000 tvm-ffi/examples/python_packaging at main · apache/tvm-ffi · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

TVM FFI Packaging Example

This is an example project that packages a tvm-ffi based library into a Python ABI-agnostic wheel.

This example can also serve as a guideline for general packaging as well.

  • Source-level build for cross-compilation support in CMake
  • Registration via global function table

Install the whee 3BA9 l

Use uv pip (the same tooling used in CI) to build and install the example wheel:

cd examples/python_packaging
uv pip install --reinstall --verbose .

Note on build and auditwheel

Note: When running the auditwheel process, make sure to skip libtvm_ffi.so as they are shipped via the tvm_ffi package.

Run the example

After installing the my_ffi_extension example package, you can run the following example.

python run_example.py

This runs four flows: calling add_two via the TVM-FFI ABI, calling add_one via the global registry, calling raise_error to demonstrate error propagation, and constructing/using the IntPair object.

0