Skip to content

⏳ Lightweight deep learning library and compiler suite built for educational purposes.

Notifications You must be signed in to change notification settings

camille-004/feathernet

Repository files navigation



Feathernet

GitHub commit activity (branch) GitHub watchers GitHub Repo stars GitHub forks


Project Status

Codecov GitLab Workflow Status GitLab Language Count

Introduction

Feathernet is a lightweight deep learning and compiler suite. Aptly named for its light-as-a-feather footprint, Feathernet is specifically crafted for those keen on exploring the realms of deep learning and compiler technology. The dl package encompasses essential deep learning components, enabling users to effortlessly build, train, and evaluate basic neural network models. The compiler package offers tools for graph optimization and Intermediate Representations (IR), positioning itself as a potential resource for understanding and implementing advanced model optimization techniques.


Table of Contents


Motivation

Deep learning compilers translate high-level neural network models into optimized, hardware-specific code, bridging the gap between theoretical model design and practical application. Examples of prominent deep learning compilers include TensorRT (inference optimization), XLA (Accelerated Linear Algebra), and Glow.

Deep Learning Compiler Framework

The venture into deep learning compilers is driven by the need to:

  • Enhance Computational Efficiency: Optimizing neural network models for specific hardware accelerates performance and reduces resource consumption.
  • Facilitate Cross-Platform Compatibility: Compilers enable models to run seamlessly across different types of hardware.
  • Democratize AI Development: By simplifying the process of model optimization, compilers make AI development more accessible to a broader range of developers and researchers.

Feathernet aims to provide an intuitive understanding of these concepts through its compiler package, offering tools for graph optimization and IRs.

Key resources for further reading on deep learning compilers:


From Scratch in Python

Feathernet's journey of being developed from scratch in Python is driven by an ambition to unveil the synergy between DL libraries and compilers. This allows us to observe and understand how these two critical components of AI technology work in tandem.

Key aspects of this approach include:

  • Integrated Development: Simultaneously crafting a deep learning library and a compiler reveals the intricate interplay between model creation and optimization. It provides a holistic view of how neural networks are translated into efficient, executable code.
  • Focus on CPU as Target: While the deep learning field often focuses on GPU optimizations, Feathernet places its emphasis on CPU capabilities. This choice offers insides into how compilers optimize for different hardware architectures, particulraly the more universally accessible CPUs.
  • Practical Learning Experience: This dual development approach grants practical insights into compiler development challenges, particularly in translating high-level neural network models into executable code.

💡 The code in the dl package of the Feathernet suite is intentionally less optimized. This is because the focus is more on the compiler aspect, emphasizing and understanding compiler technologies rather than optimizing the deep learning components themselves.


Composition

Feathernet is composed of two primary packages.

  • dl: This package encompasses core deep learning components, including layers, optimizers, initializers, and losses. Additionally, each component in the dl package is equipped with serialization capabilities, enabling integration with the compiler's Intermediate Representation (IR).
  • compiler: This package offers tools and modules for graph optimization and Intermediate Representation (IR). It includes functionalities for layer fusion, pruning, and quantization.

Running Tests

To ensure the highest quality and reliability of the code, Feathernet includes a comprehensive suite of unit tests.

Reflecting its dual-package structure, the tests in Feathernet are divided into two main categories.

  • Tests for the dl package cover deep learning components.
  • Tests for the compiler package focus on DL compiler components like graph optimization and IR.

Running Tests Locally

Prerequisite Installation
make GNU Make
poetry Poetry

About

⏳ Lightweight deep learning library and compiler suite built for educational purposes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages