sparseml-nightly


Namesparseml-nightly JSON
Version 0.6.0.20210716 PyPI version JSON
download
home_pagehttps://github.com/neuralmagic/sparseml
SummaryLibraries for applying sparsification recipes to neural networks with a few lines of code, enabling faster and smaller models
upload_time2021-07-16 15:51:57
maintainer
docs_urlNone
authorNeuralmagic, Inc.
requires_python>=3.6.0
licenseApache
keywords inference machine learning neural network computer vision nlp cv deep learning torch pytorch tensorflow keras sparsity pruning deep learning libraries onnx quantization automl
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!--
Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<h1><img alt="tool icon" src="https://raw.githubusercontent.com/neuralmagic/sparseml/main/docs/source/icon-sparseml.png" />&nbsp;&nbsp;SparseML</h1>

<h3>Libraries for applying sparsification recipes to neural networks with a few lines of code, enabling faster and smaller models</h3>

<p>
    <a href="https://docs.neuralmagic.com/sparseml/">
        <img alt="Documentation" src="https://img.shields.io/badge/documentation-darkred?&style=for-the-badge&logo=read-the-docs" height=25>
    </a>
    <a href="https://join.slack.com/t/discuss-neuralmagic/shared_invite/zt-q1a1cnvo-YBoICSIw3L1dmQpjBeDurQ/">
        <img src="https://img.shields.io/badge/slack-purple?style=for-the-badge&logo=slack" height=25>
    </a>
    <a href="https://discuss.neuralmagic.com/">
        <img src="https://img.shields.io/badge/support%20forums-navy?style=for-the-badge&logo=discourse" height=25>
    </a>
    <a href="https://github.com/neuralmagic/sparseml/actions/workflows/test-check.yaml">
        <img alt="Main" src="https://img.shields.io/github/workflow/status/neuralmagic/sparseml/Test%20Checks/main?label=build&style=for-the-badge" height=25>
    </a>
    <a href="https://github.com/neuralmagic/sparseml/releases">
        <img alt="GitHub release" src="https://img.shields.io/github/release/neuralmagic/sparseml.svg?style=for-the-badge" height=25>
    </a>
    <a href="https://github.com/neuralmagic/sparseml/blob/main/LICENSE">
        <img alt="GitHub" src="https://img.shields.io/github/license/neuralmagic/sparseml.svg?color=lightgray&style=for-the-badge" height=25>
    </a>
    <a href="https://github.com/neuralmagic/sparseml/blob/main/CODE_OF_CONDUCT.md">
        <img alt="Contributor Covenant" src="https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?color=yellow&style=for-the-badge" height=25>
    </a>
    <a href="https://www.youtube.com/channel/UCo8dO_WMGYbWCRnj_Dxr4EA">
        <img src="https://img.shields.io/badge/-YouTube-red?&style=for-the-badge&logo=youtube&logoColor=white" height=25>
    </a>
     <a href="https://medium.com/limitlessai">
        <img src="https://img.shields.io/badge/medium-%2312100E.svg?&style=for-the-badge&logo=medium&logoColor=white" height=25>
    </a>
    <a href="https://twitter.com/neuralmagic">
        <img src="https://img.shields.io/twitter/follow/neuralmagic?color=darkgreen&label=Follow&style=social" height=25>
    </a>
</p>

## Overview

SparseML is a toolkit that includes APIs, CLIs, scripts and libraries that apply state-of-the-art [sparsification](https://docs.neuralmagic.com/main/source/getstarted.html#sparsification) algorithms such as pruning and quantization to any neural network. 
General, recipe-driven approaches built around these algorithms enable the simplification of creating faster and smaller models for the ML performance community at large.

The [GitHub repository](https://github.com/neuralmagic/sparseml) contains integrations within the PyTorch, Keras, and TensorFlow V1 ecosystems, allowing for seamless model sparsification.

<img alt="SparseML Flow" src="https://docs.neuralmagic.com/docs/source/infographics/sparseml.png" width="960px" />

## Highlights

### Integrations

<p>
    <a href="https://github.com/neuralmagic/sparseml/tree/main/integrations/pytorch">
        <img src="https://docs.neuralmagic.com/docs/source/highlights/sparseml/pytorch-torchvision.png" width="136px" />
    </a>
    <a href="https://github.com/neuralmagic/sparseml/tree/main/integrations/ultralytics-yolov3">
        <img src="https://docs.neuralmagic.com/docs/source/highlights/sparseml/ultralytics-yolov3.png" width="136px" />
    </a>
    <a href="https://github.com/neuralmagic/sparseml/tree/main/integrations/ultralytics-yolov5">
        <img src="https://docs.neuralmagic.com/docs/source/highlights/sparseml/ultralytics-yolov5.png" width="136px" />
    </a>
    <a href="https://github.com/neuralmagic/sparseml/tree/main/integrations/huggingface-transformers">
        <img src="https://docs.neuralmagic.com/docs/source/highlights/sparseml/huggingface-transformers.png" width="136px" />
    </a>
    <a href="https://github.com/neuralmagic/sparseml/tree/main/integrations/rwightman-timm">
        <img src="https://docs.neuralmagic.com/docs/source/highlights/sparseml/rwightman-timm.png" width="136px" />
    </a>
</p>

### Creating Sparse Models

<p>
    <a href="https://github.com/neuralmagic/sparseml/tree/main/integrations/pytorch/notebooks/classification.ipynb">
        <img src="https://docs.neuralmagic.com/docs/source/tutorials/classification_resnet-50.png" width="136px" />
    </a>
    <a href="https://github.com/neuralmagic/sparseml/tree/main/integrations/ultralytics-yolov3/tutorials/sparsifying_yolov3_using_recipes.md">
        <img src="https://docs.neuralmagic.com/docs/source/tutorials/detection_yolov3.png" width="136px" />
    </a>
</p>

### Transfer Learning from Sparse Models

<p>
    <a href="https://github.com/neuralmagic/sparseml/tree/main/integrations/pytorch/notebooks/sparse_quantized_transfer_learning.ipynb">
        <img src="https://docs.neuralmagic.com/docs/source/tutorials/classification_resnet-50.png" width="136px" />
    </a>
</p>


## Tutorials

Coming soon!

## Installation

This repository is tested on Python 3.6+, and Linux/Debian systems.
It is recommended to install in a [virtual environment](https://docs.python.org/3/library/venv.html) to keep your system in order.
Currently supported ML Frameworks are the following: `torch>=1.1.0,<=1.8.0`, `tensorflow>=1.8.0,<=2.0.0`, `tensorflow.keras >= 2.2.0`.

Install with pip using:

```bash
pip install sparseml
```

More information on installation such as optional dependencies and requirements can be found [here](https://docs.neuralmagic.com/sparseml/source/installation.html).

## Quick Tour

To enable flexibility, ease of use, and repeatability, sparsifying a model is done using a recipe.
The recipes encode the instructions needed for modifying the model and/or training process as a list of modifiers.
Example modifiers can be anything from setting the learning rate for the optimizer to gradual magnitude pruning.
The files are written in [YAML](https://yaml.org/) and stored in YAML or [markdown](https://www.markdownguide.org/) files using [YAML front matter](https://assemble.io/docs/YAML-front-matter.html).
The rest of the SparseML system is coded to parse the recipes into a native format for the desired framework and apply the modifications to the model and training pipeline.

`ScheduledModifierManager` classes can be created from recipes in all supported ML frameworks.
The manager classes handle overriding the training graphs to apply the modifiers as described in the desired recipe.
Managers can apply recipes in one shot or training aware ways. 
One shot is invoked by calling `.apply(...)` on the manager while training aware requires calls into `initialize(...)` (optional), `modify(...)`, and `finalize(...)`.

For the frameworks, this means only a few lines of code need to be added to begin supporting pruning, quantization, and other modifications to most training pipelines.
For example, the following applies a recipe in a training aware manner:
```python
model = Model()  # model definition
optimizer = Optimizer()  # optimizer definition
train_data = TrainData()  # train data definition
batch_size = BATCH_SIZE  # training batch size
steps_per_epoch = len(train_data) // batch_size

from sparseml.pytorch.optim import ScheduledModifierManager
manager = ScheduledModifierManager.from_yaml(PATH_TO_RECIPE)
optimizer = manager.modify(model, optimizer, steps_per_epoch)

# PyTorch training code

manager.finalize(model)
```

Instead of training aware, the following example code shows how to execute a recipe in a one shot manner:
```python
model = Model()  # model definition

from sparseml.pytorch.optim import ScheduledModifierManager
manager = ScheduledModifierManager.from_yaml(PATH_TO_RECIPE)
manager.apply(model)
```

More information on the codebase and contained processes can be found in the SparseML docs:
- [Sparsification Code](https://docs.neuralmagic.com/sparseml/source/code)
- [Sparsification Recipes](https://docs.neuralmagic.com/sparseml/source/recipes)
- [Exporting to ONNX](https://docs.neuralmagic.com/sparseml/source/onnx_export)

## Resources

### Learning More

- Documentation: [SparseML](https://docs.neuralmagic.com/sparseml/), [SparseZoo](https://docs.neuralmagic.com/sparsezoo/), [Sparsify](https://docs.neuralmagic.com/sparsify/), [DeepSparse](https://docs.neuralmagic.com/deepsparse/)
- Neural Magic: [Blog](https://www.neuralmagic.com/blog/), [Resources](https://www.neuralmagic.com/resources/)

### Release History

Official builds are hosted on PyPI

- stable: [sparseml](https://pypi.org/project/sparseml/)
- nightly (dev): [sparseml-nightly](https://pypi.org/project/sparseml-nightly/)

Additionally, more information can be found via [GitHub Releases.](https://github.com/neuralmagic/sparseml/releases)

### License

The project is licensed under the [Apache License Version 2.0](https://github.com/neuralmagic/sparseml/blob/main/LICENSE).

## Community

### Contribute

We appreciate contributions to the code, examples, integrations, and documentation as well as bug reports and feature requests! [Learn how here](https://github.com/neuralmagic/sparseml/blob/main/CONTRIBUTING.md).

### Join

For user help or questions about SparseML, sign up or log in: **Deep Sparse Community** [Discourse Forum](https://discuss.neuralmagic.com/) and/or [Slack](https://join.slack.com/t/discuss-neuralmagic/shared_invite/zt-q1a1cnvo-YBoICSIw3L1dmQpjBeDurQ). We are growing the community member by member and happy to see you there.

You can get the latest news, webinar and event invites, research papers, and other ML Performance tidbits by [subscribing](https://neuralmagic.com/subscribe/) to the Neural Magic community.

For more general questions about Neural Magic, please fill out this [form](http://neuralmagic.com/contact/).

### Cite

Find this project useful in your research or other communications? Please consider citing:

```bibtex
@InProceedings{
    pmlr-v119-kurtz20a, 
    title = {Inducing and Exploiting Activation Sparsity for Fast Inference on Deep Neural Networks}, 
    author = {Kurtz, Mark and Kopinsky, Justin and Gelashvili, Rati and Matveev, Alexander and Carr, John and Goin, Michael and Leiserson, William and Moore, Sage and Nell, Bill and Shavit, Nir and Alistarh, Dan}, 
    booktitle = {Proceedings of the 37th International Conference on Machine Learning}, 
    pages = {5533--5543}, 
    year = {2020}, 
    editor = {Hal Daumé III and Aarti Singh}, 
    volume = {119}, 
    series = {Proceedings of Machine Learning Research}, 
    address = {Virtual}, 
    month = {13--18 Jul}, 
    publisher = {PMLR}, 
    pdf = {http://proceedings.mlr.press/v119/kurtz20a/kurtz20a.pdf},
    url = {http://proceedings.mlr.press/v119/kurtz20a.html}, 
    abstract = {Optimizing convolutional neural networks for fast inference has recently become an extremely active area of research. One of the go-to solutions in this context is weight pruning, which aims to reduce computational and memory footprint by removing large subsets of the connections in a neural network. Surprisingly, much less attention has been given to exploiting sparsity in the activation maps, which tend to be naturally sparse in many settings thanks to the structure of rectified linear (ReLU) activation functions. In this paper, we present an in-depth analysis of methods for maximizing the sparsity of the activations in a trained neural network, and show that, when coupled with an efficient sparse-input convolution algorithm, we can leverage this sparsity for significant performance gains. To induce highly sparse activation maps without accuracy loss, we introduce a new regularization technique, coupled with a new threshold-based sparsification method based on a parameterized activation function called Forced-Activation-Threshold Rectified Linear Unit (FATReLU). We examine the impact of our methods on popular image classification models, showing that most architectures can adapt to significantly sparser activation maps without any accuracy loss. Our second contribution is showing that these these compression gains can be translated into inference speedups: we provide a new algorithm to enable fast convolution operations over networks with sparse activations, and show that it can enable significant speedups for end-to-end inference on a range of popular models on the large-scale ImageNet image classification task on modern Intel CPUs, with little or no retraining cost.} 
}
```

```bibtex
@misc{
    singh2020woodfisher,
    title={WoodFisher: Efficient Second-Order Approximation for Neural Network Compression}, 
    author={Sidak Pal Singh and Dan Alistarh},
    year={2020},
    eprint={2004.14340},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/neuralmagic/sparseml",
    "name": "sparseml-nightly",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6.0",
    "maintainer_email": "",
    "keywords": "inference,machine learning,neural network,computer vision,nlp,cv,deep learning,torch,pytorch,tensorflow,keras,sparsity,pruning,deep learning libraries,onnx,quantization,automl",
    "author": "Neuralmagic, Inc.",
    "author_email": "support@neuralmagic.com",
    "download_url": "",
    "platform": "",
    "description": "<!--\nCopyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n\n<h1><img alt=\"tool icon\" src=\"https://raw.githubusercontent.com/neuralmagic/sparseml/main/docs/source/icon-sparseml.png\" />&nbsp;&nbsp;SparseML</h1>\n\n<h3>Libraries for applying sparsification recipes to neural networks with a few lines of code, enabling faster and smaller models</h3>\n\n<p>\n    <a href=\"https://docs.neuralmagic.com/sparseml/\">\n        <img alt=\"Documentation\" src=\"https://img.shields.io/badge/documentation-darkred?&style=for-the-badge&logo=read-the-docs\" height=25>\n    </a>\n    <a href=\"https://join.slack.com/t/discuss-neuralmagic/shared_invite/zt-q1a1cnvo-YBoICSIw3L1dmQpjBeDurQ/\">\n        <img src=\"https://img.shields.io/badge/slack-purple?style=for-the-badge&logo=slack\" height=25>\n    </a>\n    <a href=\"https://discuss.neuralmagic.com/\">\n        <img src=\"https://img.shields.io/badge/support%20forums-navy?style=for-the-badge&logo=discourse\" height=25>\n    </a>\n    <a href=\"https://github.com/neuralmagic/sparseml/actions/workflows/test-check.yaml\">\n        <img alt=\"Main\" src=\"https://img.shields.io/github/workflow/status/neuralmagic/sparseml/Test%20Checks/main?label=build&style=for-the-badge\" height=25>\n    </a>\n    <a href=\"https://github.com/neuralmagic/sparseml/releases\">\n        <img alt=\"GitHub release\" src=\"https://img.shields.io/github/release/neuralmagic/sparseml.svg?style=for-the-badge\" height=25>\n    </a>\n    <a href=\"https://github.com/neuralmagic/sparseml/blob/main/LICENSE\">\n        <img alt=\"GitHub\" src=\"https://img.shields.io/github/license/neuralmagic/sparseml.svg?color=lightgray&style=for-the-badge\" height=25>\n    </a>\n    <a href=\"https://github.com/neuralmagic/sparseml/blob/main/CODE_OF_CONDUCT.md\">\n        <img alt=\"Contributor Covenant\" src=\"https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?color=yellow&style=for-the-badge\" height=25>\n    </a>\n    <a href=\"https://www.youtube.com/channel/UCo8dO_WMGYbWCRnj_Dxr4EA\">\n        <img src=\"https://img.shields.io/badge/-YouTube-red?&style=for-the-badge&logo=youtube&logoColor=white\" height=25>\n    </a>\n     <a href=\"https://medium.com/limitlessai\">\n        <img src=\"https://img.shields.io/badge/medium-%2312100E.svg?&style=for-the-badge&logo=medium&logoColor=white\" height=25>\n    </a>\n    <a href=\"https://twitter.com/neuralmagic\">\n        <img src=\"https://img.shields.io/twitter/follow/neuralmagic?color=darkgreen&label=Follow&style=social\" height=25>\n    </a>\n</p>\n\n## Overview\n\nSparseML is a toolkit that includes APIs, CLIs, scripts and libraries that apply state-of-the-art [sparsification](https://docs.neuralmagic.com/main/source/getstarted.html#sparsification) algorithms such as pruning and quantization to any neural network. \nGeneral, recipe-driven approaches built around these algorithms enable the simplification of creating faster and smaller models for the ML performance community at large.\n\nThe [GitHub repository](https://github.com/neuralmagic/sparseml) contains integrations within the PyTorch, Keras, and TensorFlow V1 ecosystems, allowing for seamless model sparsification.\n\n<img alt=\"SparseML Flow\" src=\"https://docs.neuralmagic.com/docs/source/infographics/sparseml.png\" width=\"960px\" />\n\n## Highlights\n\n### Integrations\n\n<p>\n    <a href=\"https://github.com/neuralmagic/sparseml/tree/main/integrations/pytorch\">\n        <img src=\"https://docs.neuralmagic.com/docs/source/highlights/sparseml/pytorch-torchvision.png\" width=\"136px\" />\n    </a>\n    <a href=\"https://github.com/neuralmagic/sparseml/tree/main/integrations/ultralytics-yolov3\">\n        <img src=\"https://docs.neuralmagic.com/docs/source/highlights/sparseml/ultralytics-yolov3.png\" width=\"136px\" />\n    </a>\n    <a href=\"https://github.com/neuralmagic/sparseml/tree/main/integrations/ultralytics-yolov5\">\n        <img src=\"https://docs.neuralmagic.com/docs/source/highlights/sparseml/ultralytics-yolov5.png\" width=\"136px\" />\n    </a>\n    <a href=\"https://github.com/neuralmagic/sparseml/tree/main/integrations/huggingface-transformers\">\n        <img src=\"https://docs.neuralmagic.com/docs/source/highlights/sparseml/huggingface-transformers.png\" width=\"136px\" />\n    </a>\n    <a href=\"https://github.com/neuralmagic/sparseml/tree/main/integrations/rwightman-timm\">\n        <img src=\"https://docs.neuralmagic.com/docs/source/highlights/sparseml/rwightman-timm.png\" width=\"136px\" />\n    </a>\n</p>\n\n### Creating Sparse Models\n\n<p>\n    <a href=\"https://github.com/neuralmagic/sparseml/tree/main/integrations/pytorch/notebooks/classification.ipynb\">\n        <img src=\"https://docs.neuralmagic.com/docs/source/tutorials/classification_resnet-50.png\" width=\"136px\" />\n    </a>\n    <a href=\"https://github.com/neuralmagic/sparseml/tree/main/integrations/ultralytics-yolov3/tutorials/sparsifying_yolov3_using_recipes.md\">\n        <img src=\"https://docs.neuralmagic.com/docs/source/tutorials/detection_yolov3.png\" width=\"136px\" />\n    </a>\n</p>\n\n### Transfer Learning from Sparse Models\n\n<p>\n    <a href=\"https://github.com/neuralmagic/sparseml/tree/main/integrations/pytorch/notebooks/sparse_quantized_transfer_learning.ipynb\">\n        <img src=\"https://docs.neuralmagic.com/docs/source/tutorials/classification_resnet-50.png\" width=\"136px\" />\n    </a>\n</p>\n\n\n## Tutorials\n\nComing soon!\n\n## Installation\n\nThis repository is tested on Python 3.6+, and Linux/Debian systems.\nIt is recommended to install in a [virtual environment](https://docs.python.org/3/library/venv.html) to keep your system in order.\nCurrently supported ML Frameworks are the following: `torch>=1.1.0,<=1.8.0`, `tensorflow>=1.8.0,<=2.0.0`, `tensorflow.keras >= 2.2.0`.\n\nInstall with pip using:\n\n```bash\npip install sparseml\n```\n\nMore information on installation such as optional dependencies and requirements can be found [here](https://docs.neuralmagic.com/sparseml/source/installation.html).\n\n## Quick Tour\n\nTo enable flexibility, ease of use, and repeatability, sparsifying a model is done using a recipe.\nThe recipes encode the instructions needed for modifying the model and/or training process as a list of modifiers.\nExample modifiers can be anything from setting the learning rate for the optimizer to gradual magnitude pruning.\nThe files are written in [YAML](https://yaml.org/) and stored in YAML or [markdown](https://www.markdownguide.org/) files using [YAML front matter](https://assemble.io/docs/YAML-front-matter.html).\nThe rest of the SparseML system is coded to parse the recipes into a native format for the desired framework and apply the modifications to the model and training pipeline.\n\n`ScheduledModifierManager` classes can be created from recipes in all supported ML frameworks.\nThe manager classes handle overriding the training graphs to apply the modifiers as described in the desired recipe.\nManagers can apply recipes in one shot or training aware ways. \nOne shot is invoked by calling `.apply(...)` on the manager while training aware requires calls into `initialize(...)` (optional), `modify(...)`, and `finalize(...)`.\n\nFor the frameworks, this means only a few lines of code need to be added to begin supporting pruning, quantization, and other modifications to most training pipelines.\nFor example, the following applies a recipe in a training aware manner:\n```python\nmodel = Model()  # model definition\noptimizer = Optimizer()  # optimizer definition\ntrain_data = TrainData()  # train data definition\nbatch_size = BATCH_SIZE  # training batch size\nsteps_per_epoch = len(train_data) // batch_size\n\nfrom sparseml.pytorch.optim import ScheduledModifierManager\nmanager = ScheduledModifierManager.from_yaml(PATH_TO_RECIPE)\noptimizer = manager.modify(model, optimizer, steps_per_epoch)\n\n# PyTorch training code\n\nmanager.finalize(model)\n```\n\nInstead of training aware, the following example code shows how to execute a recipe in a one shot manner:\n```python\nmodel = Model()  # model definition\n\nfrom sparseml.pytorch.optim import ScheduledModifierManager\nmanager = ScheduledModifierManager.from_yaml(PATH_TO_RECIPE)\nmanager.apply(model)\n```\n\nMore information on the codebase and contained processes can be found in the SparseML docs:\n- [Sparsification Code](https://docs.neuralmagic.com/sparseml/source/code)\n- [Sparsification Recipes](https://docs.neuralmagic.com/sparseml/source/recipes)\n- [Exporting to ONNX](https://docs.neuralmagic.com/sparseml/source/onnx_export)\n\n## Resources\n\n### Learning More\n\n- Documentation: [SparseML](https://docs.neuralmagic.com/sparseml/), [SparseZoo](https://docs.neuralmagic.com/sparsezoo/), [Sparsify](https://docs.neuralmagic.com/sparsify/), [DeepSparse](https://docs.neuralmagic.com/deepsparse/)\n- Neural Magic: [Blog](https://www.neuralmagic.com/blog/), [Resources](https://www.neuralmagic.com/resources/)\n\n### Release History\n\nOfficial builds are hosted on PyPI\n\n- stable: [sparseml](https://pypi.org/project/sparseml/)\n- nightly (dev): [sparseml-nightly](https://pypi.org/project/sparseml-nightly/)\n\nAdditionally, more information can be found via [GitHub Releases.](https://github.com/neuralmagic/sparseml/releases)\n\n### License\n\nThe project is licensed under the [Apache License Version 2.0](https://github.com/neuralmagic/sparseml/blob/main/LICENSE).\n\n## Community\n\n### Contribute\n\nWe appreciate contributions to the code, examples, integrations, and documentation as well as bug reports and feature requests! [Learn how here](https://github.com/neuralmagic/sparseml/blob/main/CONTRIBUTING.md).\n\n### Join\n\nFor user help or questions about SparseML, sign up or log in: **Deep Sparse Community** [Discourse Forum](https://discuss.neuralmagic.com/) and/or [Slack](https://join.slack.com/t/discuss-neuralmagic/shared_invite/zt-q1a1cnvo-YBoICSIw3L1dmQpjBeDurQ). We are growing the community member by member and happy to see you there.\n\nYou can get the latest news, webinar and event invites, research papers, and other ML Performance tidbits by [subscribing](https://neuralmagic.com/subscribe/) to the Neural Magic community.\n\nFor more general questions about Neural Magic, please fill out this [form](http://neuralmagic.com/contact/).\n\n### Cite\n\nFind this project useful in your research or other communications? Please consider citing:\n\n```bibtex\n@InProceedings{\n    pmlr-v119-kurtz20a, \n    title = {Inducing and Exploiting Activation Sparsity for Fast Inference on Deep Neural Networks}, \n    author = {Kurtz, Mark and Kopinsky, Justin and Gelashvili, Rati and Matveev, Alexander and Carr, John and Goin, Michael and Leiserson, William and Moore, Sage and Nell, Bill and Shavit, Nir and Alistarh, Dan}, \n    booktitle = {Proceedings of the 37th International Conference on Machine Learning}, \n    pages = {5533--5543}, \n    year = {2020}, \n    editor = {Hal Daum\u00e9 III and Aarti Singh}, \n    volume = {119}, \n    series = {Proceedings of Machine Learning Research}, \n    address = {Virtual}, \n    month = {13--18 Jul}, \n    publisher = {PMLR}, \n    pdf = {http://proceedings.mlr.press/v119/kurtz20a/kurtz20a.pdf},\n    url = {http://proceedings.mlr.press/v119/kurtz20a.html}, \n    abstract = {Optimizing convolutional neural networks for fast inference has recently become an extremely active area of research. One of the go-to solutions in this context is weight pruning, which aims to reduce computational and memory footprint by removing large subsets of the connections in a neural network. Surprisingly, much less attention has been given to exploiting sparsity in the activation maps, which tend to be naturally sparse in many settings thanks to the structure of rectified linear (ReLU) activation functions. In this paper, we present an in-depth analysis of methods for maximizing the sparsity of the activations in a trained neural network, and show that, when coupled with an efficient sparse-input convolution algorithm, we can leverage this sparsity for significant performance gains. To induce highly sparse activation maps without accuracy loss, we introduce a new regularization technique, coupled with a new threshold-based sparsification method based on a parameterized activation function called Forced-Activation-Threshold Rectified Linear Unit (FATReLU). We examine the impact of our methods on popular image classification models, showing that most architectures can adapt to significantly sparser activation maps without any accuracy loss. Our second contribution is showing that these these compression gains can be translated into inference speedups: we provide a new algorithm to enable fast convolution operations over networks with sparse activations, and show that it can enable significant speedups for end-to-end inference on a range of popular models on the large-scale ImageNet image classification task on modern Intel CPUs, with little or no retraining cost.} \n}\n```\n\n```bibtex\n@misc{\n    singh2020woodfisher,\n    title={WoodFisher: Efficient Second-Order Approximation for Neural Network Compression}, \n    author={Sidak Pal Singh and Dan Alistarh},\n    year={2020},\n    eprint={2004.14340},\n    archivePrefix={arXiv},\n    primaryClass={cs.LG}\n}\n```\n\n\n",
    "bugtrack_url": null,
    "license": "Apache",
    "summary": "Libraries for applying sparsification recipes to neural networks with a few lines of code, enabling faster and smaller models",
    "version": "0.6.0.20210716",
    "split_keywords": [
        "inference",
        "machine learning",
        "neural network",
        "computer vision",
        "nlp",
        "cv",
        "deep learning",
        "torch",
        "pytorch",
        "tensorflow",
        "keras",
        "sparsity",
        "pruning",
        "deep learning libraries",
        "onnx",
        "quantization",
        "automl"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "b6170d15f9a3e693c5b6779f88250a58",
                "sha256": "7ca1f2a1287a30ece8de1410cdd27549c66c2d99b10c8e21831465d5c666d0b5"
            },
            "downloads": -1,
            "filename": "sparseml_nightly-0.6.0.20210716-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b6170d15f9a3e693c5b6779f88250a58",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6.0",
            "size": 533226,
            "upload_time": "2021-07-16T15:51:57",
            "upload_time_iso_8601": "2021-07-16T15:51:57.846485Z",
            "url": "https://files.pythonhosted.org/packages/bd/ab/7869724a032314df9a70826157da4ae707844575fcdb019ee9af1f6e58b3/sparseml_nightly-0.6.0.20210716-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-07-16 15:51:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "neuralmagic",
    "github_project": "sparseml",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sparseml-nightly"
}
        
Elapsed time: 0.30887s