tensorflow / tensorflow/model-optimization

Support for block sparse matrices

Open
#542 2 comments 0 reactions 1 assignee View on GitHub

@liyunlu0618 is already working on this.

Since Apr 20, 2021.

feature request
Dominant language
Python
Stars
1.6k
Forks
349
Avg merge
3d 2h
Merged PRs (30d)
1

Description

System information

  • TensorFlow version (you are using): 2.3
  • Are you willing to contribute it (Yes/No): I can write tutorials.

Motivation

Sparsity is a well-studied topic in neural networks that is highly relevant from both research and engineering fronts. Model optimization techniques like pruning are fueled by the idea of sparsity. Moreover, it plays even better when combined with techniques like quantization, and knowledge distillation.

tfmot provides us with good support for pruning by allowing it from many different flavors like training models with pruning schedules from scratch instead of re-training them, ability to customize pruning mechanics within a model at a layer-level, etc.

OpenAI folks propose block sparse kernels as an improvement/alternative to rigorous sparse kernels and they show that it can greatly improve the computation time. Here's the original blog post. Here's the original paper.

As examples:

  1. Instead of using Dense layers use block sparse layers in the first place. Here's some motivation from Hugging Face.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.