Skip to content

panickal-xmos/ai_tools

 
 

Repository files navigation

AI/ML tools repository

Installation

xmos-ai-tools is available on PyPi. It includes:

  • the MLIR-based XCore optimizer(xformer) to optimize Tensorflow Lite models for XCore
  • the XCore tflm interpreter to run the transformed models on host
  • the XCore tflm interpreter to run the transformed models on an xcore device connected over usb or spi

It can be installed with the following command:

pip install xmos-ai-tools

If you want to install the latest development version, use:

pip install xmos-ai-tools --pre

Installing xmos-ai-tools will make the xcore-opt binary available in your shell to use directly, or you can use the Python interface as detailed here.

Building xmos-ai-tools

Some dependent libraries are included as git submodules. These can be obtained by cloning this repository with the following commands:

git clone [email protected]:xmos/ai_tools.git
cd ai_tools
make submodule_update

Install at least version 15 of the XMOS tools from your preferred location and activate it by sourcing SetEnv in the installation root.

CMake 3.14 or newer is required for building libraries and test firmware. A correct version of CMake (and make) is included in the Conda environment file, utils/environment.yml. To set up and activate the environment, simply run:

conda env create -p ./ai_tools_venv -f environment.yml
conda activate ai_tools_venv/

Build the XCore host tflm interpreter libraries with default settings (see the Makefile for more), run:

make build

Install the necessary python packages and the xtftlm_interpreter python package using pip (inside the conda venv):

pip install -r "./requirements.txt"

After following the above instructions, to build xformer, please follow the build instructions here.

About

AI applications and tools

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 64.8%
  • MLIR 19.9%
  • C++ 10.2%
  • Jupyter Notebook 2.0%
  • Starlark 1.1%
  • HTML 1.0%
  • Other 1.0%