Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 0a4a97a

Browse files
authored
Add structure and pages to sphinx (#52)
1 parent fc8baa0 commit 0a4a97a

File tree

26 files changed

+540
-102
lines changed

26 files changed

+540
-102
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ tensorboard/*
2020
onnx/*
2121
repos/*
2222

23-
*.rst
23+
/docs/source/api/*.rst
2424

2525
### Python template
2626
# Byte-compiled / optimized / DLL files

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ BUILDDIR := $(PWD)
44
CHECKDIRS := examples notebooks scripts src tests utils setup.py
55
CHECKGLOBS := 'examples/**/*.py' 'scripts/**/*.py' 'src/**/*.py' 'tests/**/*.py' 'utils/**/*.py' setup.py
66
DOCDIR := docs
7-
MDCHECKGLOBS := 'docs/**/*.md' 'examples/**/*.md' 'notebooks/**/*.md' 'scripts/**/*.md'
7+
MDCHECKGLOBS := 'docs/**/*.md' 'docs/**/*.rst' 'examples/**/*.md' 'notebooks/**/*.md' 'scripts/**/*.md'
88
MDCHECKFILES := CODE_OF_CONDUCT.md CONTRIBUTING.md DEVELOPING.md README.md
99

1010
TARGETS := "" # targets for running pytests: keras,onnx,pytorch,pytorch_models,pytorch_datasets,tensorflow_v1,tensorflow_v1_models,tensorflow_v1_datasets
@@ -58,8 +58,8 @@ test:
5858

5959
# create docs
6060
docs:
61-
sphinx-apidoc -o "$(DOCDIR)/source/" src/sparseml;
62-
cd $(DOCDIR) && $(MAKE) html;
61+
export SPARSEML_IGNORE_TFV1="True"; sphinx-apidoc -o "$(DOCDIR)/source/api/" src/sparseml;
62+
export SPARSEML_IGNORE_TFV1="True"; cd $(DOCDIR) && $(MAKE) html;
6363

6464
# creates wheel file
6565
build:

docs/README.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/source/api/.gitkeep

Whitespace-only changes.

docs/source/conf.py

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@
1818

1919
# -- Project information -----------------------------------------------------
2020

21-
project = "sparseml"
22-
copyright = "2020, Neural Magic"
21+
project = "SparseML"
22+
copyright = (
23+
"Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved. "
24+
'Licensed under the Apache License, Version 2.0 (the "License")'
25+
)
2326
author = "Neural Magic"
2427

2528
# The full version, including alpha/beta/rc tags
26-
version = ""
27-
release = "1.0.9"
29+
version = "0.1"
30+
release = "0.1.0"
2831

2932

3033
# -- General configuration ---------------------------------------------------
@@ -34,12 +37,17 @@
3437
# ones.
3538
extensions = [
3639
"sphinx.ext.autodoc",
37-
"sphinx.ext.intersphinx",
40+
"sphinx.ext.coverage",
41+
"sphinx.ext.extlinks",
42+
"sphinx.ext.githubpages",
3843
"sphinx.ext.ifconfig",
44+
"sphinx.ext.intersphinx",
45+
"sphinx.ext.napoleon",
3946
"sphinx.ext.viewcode",
40-
"sphinx.ext.githubpages",
41-
"rinoh.frontend.sphinx",
47+
"sphinx_copybutton",
48+
"sphinx_markdown_tables",
4249
"sphinx_rtd_theme",
50+
"recommonmark",
4351
]
4452

4553
# Add any paths that contain templates here, relative to this directory.
@@ -48,11 +56,11 @@
4856
# The suffix(es) of source filenames.
4957
# You can specify multiple suffix as a list of string:
5058
#
51-
# source_suffix = ['.rst', '.md']
52-
source_suffix = ".rst"
59+
source_suffix = [".rst", ".md"]
60+
# source_suffix = ".rst"
5361

5462
# The master toctree document.
55-
master_doc = "sparseml"
63+
master_doc = "index"
5664

5765
# The language for content autogenerated by Sphinx. Refer to documentation
5866
# for a list of supported languages.
@@ -76,6 +84,7 @@
7684
# a list of builtin themes.
7785
#
7886
html_theme = "sphinx_rtd_theme"
87+
html_logo = "icon-sparseml.png"
7988

8089
# Add any paths that contain custom static files (such as style sheets) here,
8190
# relative to this directory. They are copied after the builtin static files,
@@ -92,39 +101,35 @@
92101
#
93102
# html_sidebars = {}
94103

104+
html_favicon = "favicon.ico"
105+
95106
# -- Options for HTMLHelp output ---------------------------------------------
96107

97108
# Output file base name for HTML help builder.
98-
htmlhelp_basename = "sparseMLdoc"
109+
htmlhelp_basename = "sparsemldoc"
99110

100111

101112
# -- Options for LaTeX output ------------------------------------------------
102113

103114
latex_elements = {
104-
"papersize": "letterpaper",
105-
"pointsize": "10pt",
106-
"preamble": "",
107-
"figure_align": "htbp",
115+
# "papersize": "letterpaper",
116+
# "pointsize": "10pt",
117+
# "preamble": "",
118+
# "figure_align": "htbp",
108119
}
109120

110121
# Grouping the document tree into LaTeX files. List of tuples
111122
# (source start file, target name, title,
112123
# author, documentclass [howto, manual, or own class]).
113124
latex_documents = [
114-
(
115-
master_doc,
116-
"SparseML_API.tex",
117-
"SparseML API",
118-
"Neural Magic",
119-
"manual",
120-
),
125+
(master_doc, "sparseml.tex", "SparseML Documentation", [author], "manual",),
121126
]
122127

123128
# -- Options for manual page output ------------------------------------------
124129

125130
# One entry per manual page. List of tuples
126131
# (source start file, name, description, authors, manual section).
127-
man_pages = [(master_doc, "sparsemlapi", "SparseML API Documentation", [author], 1)]
132+
man_pages = [(master_doc, "sparseml", "SparseML Documentation", [author], 1)]
128133

129134

130135
# -- Options for Texinfo output ----------------------------------------------
@@ -135,11 +140,14 @@
135140
texinfo_documents = [
136141
(
137142
master_doc,
138-
"",
139-
"SparseML API Documentation",
143+
"sparseml",
144+
"SparseML Documentation",
140145
author,
141-
"SparseML_API",
142-
"API implementations designed for ML frameworks to enable better performance in the Neural Magic system.",
146+
"sparseml",
147+
(
148+
"Libraries for state-of-the-art deep neural network optimization "
149+
"algorithms, enabling simple pipelines integration with a few lines of code"
150+
),
143151
"Miscellaneous",
144152
),
145153
]
@@ -163,7 +171,7 @@
163171
# epub_uid = ''
164172

165173
# A list of files that should not be packed into the epub file.
166-
epub_exclude_files = ["search.html"]
174+
epub_exclude_files = []
167175

168176

169177
# -- Extension configuration -------------------------------------------------

docs/source/favicon.ico

15 KB
Binary file not shown.

docs/source/index.rst

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
..
2+
Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing,
11+
software distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
===================
17+
SparseML |version|
18+
===================
19+
20+
Libraries for state-of-the-art deep neural network optimization algorithms,
21+
enabling simple pipelines integration with a few lines of code
22+
23+
.. raw:: html
24+
25+
<div style="margin-bottom:16px;">
26+
<a href="https://github.com/neuralmagic/sparseml/blob/master/LICENSE">
27+
<img alt="GitHub" src="https://img.shields.io/github/license/neuralmagic/sparseml.svg?color=purple&style=for-the-badge" height=25 style="margin-bottom:4px;">
28+
</a>
29+
<a href="https://docs.neuralmagic.com/sparseml/index.html">
30+
<img alt="Documentation" src="https://img.shields.io/website/http/neuralmagic.com/sparseml/index.html.svg?down_color=red&down_message=offline&up_message=online&style=for-the-badge" height=25 style="margin-bottom:4px;">
31+
</a>
32+
<a href="https://github.com/neuralmagic/sparseml/releases">
33+
<img alt="GitHub release" src="https://img.shields.io/github/release/neuralmagic/sparseml.svg?style=for-the-badge" height=25 style="margin-bottom:4px;">
34+
</a>
35+
<a href="https://github.com/neuralmagic.com/sparseml/blob/master/CODE_OF_CONDUCT.md">
36+
<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 style="margin-bottom:4px;">
37+
</a>
38+
<a href="https://www.youtube.com/channel/UCo8dO_WMGYbWCRnj_Dxr4EA">
39+
<img src="https://img.shields.io/badge/-YouTube-red?&style=for-the-badge&logo=youtube&logoColor=white" height=25 style="margin-bottom:4px;">
40+
</a>
41+
<a href="https://medium.com/limitlessai">
42+
<img src="https://img.shields.io/badge/medium-%2312100E.svg?&style=for-the-badge&logo=medium&logoColor=white" height=25 style="margin-bottom:4px;">
43+
</a>
44+
<a href="https://twitter.com/neuralmagic">
45+
<img src="https://img.shields.io/twitter/follow/neuralmagic?color=darkgreen&label=Follow&style=social" height=25 style="margin-bottom:4px;">
46+
</a>
47+
</div>
48+
49+
Overview
50+
========
51+
52+
SparseML is a toolkit that includes APIs, CLIs, scripts and libraries that apply state-of-the-art optimization
53+
algorithms such as `pruning <https://neuralmagic.com/blog/pruning-overview/ />`_ and
54+
`quantization <https://arxiv.org/abs/1609.07061 />`_ to any neural network.
55+
General, recipe-driven approaches built around these optimizations enable the simplification of creating faster
56+
and smaller models for the ML performance community at large.
57+
58+
SparseML is integrated for easy model optimizations within the `PyTorch <https://pytorch.org/ />`_,
59+
`Keras <https://keras.io/ />`_, and `TensorFlow V1 <http://tensorflow.org/ />`_ ecosystems currently.
60+
61+
Related Products
62+
================
63+
64+
- `DeepSparse <https://github.com/neuralmagic/deepsparse />`_:
65+
CPU inference engine that delivers unprecedented performance for sparse models
66+
- `Sparse Zoo <https://github.com/neuralmagic/sparsezoo />`_:
67+
Neural network model repository for highly sparse models and optimization recipes
68+
- `Sparsify <https://github.com/neuralmagic/sparsify />`_:
69+
Easy-to-use autoML interface to optimize deep neural networks for
70+
better inference performance and a smaller footprint
71+
72+
Resources and Learning More
73+
===========================
74+
75+
- `SparseZoo Documentation <https://docs.neuralmagic.com/sparsezoo/ />`_
76+
- `SparseML Documentation <https://docs.neuralmagic.com/sparseml/ />`_
77+
- `Sparsify Documentation <https://docs.neuralmagic.com/sparsify/ />`_
78+
- `DeepSparse Documentation <https://docs.neuralmagic.com/deepsparse/ />`_
79+
- `Neural Magic Blog <https://www.neuralmagic.com/blog/ />`_,
80+
`Resources <https://www.neuralmagic.com/resources/ />`_,
81+
`Website <https://www.neuralmagic.com/ />`_
82+
83+
Release History
84+
===============
85+
86+
Official builds are hosted on PyPi
87+
- stable: `sparsezoo <https://pypi.org/project/sparseml/ />`_
88+
- nightly (dev): `sparsezoo-nightly <https://pypi.org/project/sparseml-nightly/ />`_
89+
90+
Additionally, more information can be found via
91+
`GitHub Releases <https://github.com/neuralmagic/sparseml/releases />`_.
92+
93+
.. toctree::
94+
:maxdepth: 3
95+
:caption: General
96+
97+
quicktour
98+
installation
99+
recipes
100+
101+
.. toctree::
102+
:maxdepth: 2
103+
:caption: API
104+
105+
api/sparseml

docs/source/installation.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!--
2+
Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing,
11+
software distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
### Installation
18+
19+
This repository is tested on Python 3.6+, and Linux/Debian systems.
20+
It is recommended to install in a [virtual environment](https://docs.python.org/3/library/venv.html)
21+
to keep your system in order.
22+
23+
Install with pip using:
24+
25+
```bash
26+
pip install sparsezoo
27+
```
28+
29+
Then if you would like to explore any of the [scripts](https://github.com/neuralmagic/sparsezoo/tree/main/scripts),
30+
[notebooks](https://github.com/neuralmagic/sparsezoo/tree/main/notebooks),
31+
or [examples](https://github.com/neuralmagic/sparsezoo/tree/main/examples)
32+
clone the repository and install any additional dependencies as required.

0 commit comments

Comments
 (0)