Skip to content

mingkaic/tenncor

Repository files navigation

Tenncor

Build Status codecov

Synopsis

Tenncor libraries help developers build and evaluate tensor equations and its derivatives. A tensor is an N-dimensional container that organizes its content by some shape. An M by N matrix for instance, is a 2-dimensional tensor with a shape of [N, M] (according to Tenncor's x-y-z-... coordinate notation).

Core Components

This module supplies syntax tree for equation and generates derivative. Constraints to the equation is limited to each tensor's shape.

Tensor objects acts as the function graph scaffolding. Tensor scaffolding has the following actors:

  • Session/Traveler access graph scaffolding.
  • External Optimizer manipulates graph scaffolding.
  • GradBuilder generates more graph scaffolding.

This module wraps eigen operators using TEQ shape and coordinate arguments.

Eigen objects hold the real data and provides API to manipulate the data.

This module marshals any TEQ graph, but requires data serialization functors when saving and loading.

This module defines marshable objects used as attribute values

This module looks up TEQ subgraphs according to structural pattern, attributes, variable shapes or labels

This module specifies graph optimization through TEQ subgraph Query.

This module is implements basic operations for Tenncor's TEQ Tensor objects generated through pybinder.

Additionally, ETEQ also defines data format and (de)serialization methods required by PBM.

This module contains utility functions for common machine learning api

Supplemental Components

This module is contains debug libraries for TEQ Graphs.

General diagram

High-level diagram available: https://drive.google.com/file/d/1PrsFa7Duj4Whlu_m0lmFr5JGikGnU3gC/view?usp=sharing

Generators

GEN

This is a generic generator for creating files from dictionary of objects and extensible plugins

EGEN

This is the generator for EIGEN/ETEQ module. Generated files include:

  • opcode: which defines OPERATION enum, operator metadata, switch case macros, and Eigen operator creation
  • type: which defines DATA TYPE enum, type metadata, and switch case macros
  • api, and pyapi: which defines APIs in C++ and python (through Pybind11)

Building

Tenncor uses bazel 0.28+. Building with bazel before 2.0 has duplicate symbols issues. Will investigate after C++ Module support

Download bazel: https://docs.bazel.build/versions/master/install.html

Conan installation

Before install package first add remote: conan remote add mingkaic-co "https://gitlab.com/api/v4/projects/23299689/packages/conan" Add requirement tenncor/<version>@mingkaic-co/stable

Pip installation

Pypi repository is experimental. Best way for installation is to download from directory: pip3 install $(path_to_tenncor)/tenncor/