Coder Social home page Coder Social logo

iree-torch's Introduction

Torch frontend for IREE [Under Construction]

This project provides end-to-end flows supporting users of PyTorch that want to target IREE as a compiler backend. We use the Torch-MLIR project to provide our PyTorch frontend.

Planned features

  • Python (or, if absolutely necessary, C++) code that pulls in the bindings from both projects into an end-to-end flow for users.
  • Docker images for users to be able to quickly get started
  • CI of the Torch-MLIR end-to-end tests, with IREE plugged in as a backend
  • User examples:
    • Jupyter notebooks using the above to demonstrate interactive use of the tools
    • Standalone user-level Python code demonstrating various deployment flows (mobile, embedded).

Running end-to-end correctness tests

Setup the venv for running:

# Create a Python virtual environment.
$ python -m venv iree-torch.venv
$ source iree-torch.venv/bin/activate

# Option 1: Install Torch-MLIR and IREE from nightly packages:
(iree-torch.venv) $ python -m pip install -r "${IREE_TORCH_SRC_ROOT}/requirements.txt"

# Option 2: For development, build from source and set `PYTHONPATH`:
ninja -C "${TORCH_MLIR_BUILD_ROOT}" TorchMLIRPythonModules
ninja -C "${IREE_BUILD_ROOT}" IREECompilerPythonModules bindings_python_iree_runtime_runtime
export PYTHONPATH="${IREE_BUILD_ROOT}/runtime/bindings/python:${IREE_BUILD_ROOT}/compiler/bindings/python:${TORCH_MLIR_BUILD_ROOT}/tools/torch-mlir/python_packages/torch_mlir:${PYTHONPATH}"

Run the Torch-MLIR TorchScript e2e test suite on IREE:

# Run all the tests on the default backend (`dylib`).
(iree-torch.venv) $ tools/torchscript_e2e_test.sh
# Run all tests on the `vmvx` backend.
(iree-torch.venv) $ tools/torchscript_e2e_test.sh --config vmvx
# Filter the tests (with a regex) and report failures with verbose error messages.
# This is good for drilling down on a single test as well.
(iree-torch.venv) $ tools/torchscript_e2e_test.sh --filter Elementwise --verbose
# Shorter option names.
(iree-torch.venv) $ tools/torchscript_e2e_test.sh -f Elementwise -v

iree-torch's People

Contributors

ramiro050 avatar silvasean avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.