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

Commit 92cc374

Browse files
authored
update sparseml docs from latest on main (#3)
1 parent bc2f137 commit 92cc374

File tree

7 files changed

+45
-25
lines changed

7 files changed

+45
-25
lines changed

sparseml/_modules/sparseml/optim/modifier.html

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,24 @@ <h1>Source code for sparseml.optim.modifier</h1><div class="highlight"><pre>
470470
<span class="n">modifiers</span> <span class="o">=</span> <span class="p">[</span><span class="n">container</span><span class="p">]</span>
471471
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">container</span><span class="p">,</span> <span class="n">List</span><span class="p">):</span>
472472
<span class="n">modifiers</span> <span class="o">=</span> <span class="n">container</span>
473-
<span class="k">else</span><span class="p">:</span>
474-
<span class="n">modifiers</span> <span class="o">=</span> <span class="n">container</span><span class="p">[</span><span class="s2">&quot;modifiers&quot;</span><span class="p">]</span>
473+
<span class="k">else</span><span class="p">:</span> <span class="c1"># Dict</span>
474+
<span class="n">modifiers</span> <span class="o">=</span> <span class="p">[]</span>
475+
<span class="k">for</span> <span class="n">name</span><span class="p">,</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">container</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
476+
<span class="k">if</span> <span class="s2">&quot;modifiers&quot;</span> <span class="ow">in</span> <span class="n">name</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">List</span><span class="p">):</span>
477+
<span class="n">modifiers</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>
478+
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">BaseModifier</span><span class="p">):</span>
479+
<span class="n">modifiers</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>
480+
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">List</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">any</span><span class="p">(</span>
481+
<span class="nb">isinstance</span><span class="p">(</span><span class="n">element</span><span class="p">,</span> <span class="n">BaseModifier</span><span class="p">)</span> <span class="k">for</span> <span class="n">element</span> <span class="ow">in</span> <span class="n">item</span>
482+
<span class="p">):</span>
483+
<span class="n">modifier_type</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span>
484+
<span class="p">[</span><span class="n">mod</span> <span class="k">for</span> <span class="n">mod</span> <span class="ow">in</span> <span class="n">item</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">mod</span><span class="p">,</span> <span class="n">BaseModifier</span><span class="p">)][</span><span class="mi">0</span><span class="p">]</span>
485+
<span class="p">)</span>
486+
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
487+
<span class="s2">&quot;Invalid modifier location. Grouped modifiers in recipes must &quot;</span>
488+
<span class="s2">&quot;be listed in lists with &#39;modifiers&#39; in its name. A modifier of &quot;</span>
489+
<span class="sa">f</span><span class="s2">&quot;type </span><span class="si">{</span><span class="n">modifier_type</span><span class="si">}</span><span class="s2"> was found in recipe list </span><span class="si">{</span><span class="n">name</span><span class="si">}</span><span class="s2">&quot;</span>
490+
<span class="p">)</span>
475491

476492
<span class="k">return</span> <span class="n">modifiers</span></div>
477493

sparseml/_modules/sparseml/tensorflow_v1/utils/variable.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ <h1>Source code for sparseml.tensorflow_v1.utils.variable</h1><div class="highli
197197
<span class="k">try</span><span class="p">:</span>
198198
<span class="kn">import</span> <span class="nn">tensorflow.contrib.graph_editor</span> <span class="k">as</span> <span class="nn">graph_editor</span>
199199
<span class="kn">from</span> <span class="nn">tensorflow.contrib.graph_editor.util</span> <span class="kn">import</span> <span class="n">ListView</span>
200+
200201
<span class="n">tf_contrib_err</span> <span class="o">=</span> <span class="kc">None</span>
201202
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">err</span><span class="p">:</span>
202203
<span class="n">graph_editor</span> <span class="o">=</span> <span class="kc">None</span>

sparseml/_sources/index.rst.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ Overview
5050
========
5151

5252
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
53+
algorithms such as `pruning <https://neuralmagic.com/blog/pruning-overview />`_ and
5454
`quantization <https://arxiv.org/abs/1609.07061 />`_ to any neural network.
5555
General, recipe-driven approaches built around these optimizations enable the simplification of creating faster
5656
and smaller models for the ML performance community at large.
5757

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.
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.
6060

6161
Related Products
6262
================
@@ -72,19 +72,19 @@ Related Products
7272
Resources and Learning More
7373
===========================
7474

75-
- `SparseZoo Documentation <https://docs.neuralmagic.com/sparsezoo/ />`_
76-
- `Sparsify Documentation <https://docs.neuralmagic.com/sparsify/ />`_
77-
- `DeepSparse Documentation <https://docs.neuralmagic.com/deepsparse/ />`_
78-
- `Neural Magic Blog <https://www.neuralmagic.com/blog/ />`_,
79-
`Resources <https://www.neuralmagic.com/resources/ />`_,
80-
`Website <https://www.neuralmagic.com/ />`_
75+
- `SparseZoo Documentation <https://docs.neuralmagic.com/sparsezoo />`_
76+
- `Sparsify Documentation <https://docs.neuralmagic.com/sparsify />`_
77+
- `DeepSparse Documentation <https://docs.neuralmagic.com/deepsparse />`_
78+
- `Neural Magic Blog <https://www.neuralmagic.com/blog />`_,
79+
`Resources <https://www.neuralmagic.com/resources />`_,
80+
`Website <https://www.neuralmagic.com />`_
8181

8282
Release History
8383
===============
8484

8585
Official builds are hosted on PyPi
86-
- stable: `sparseml <https://pypi.org/project/sparseml/ />`_
87-
- nightly (dev): `sparseml-nightly <https://pypi.org/project/sparseml-nightly/ />`_
86+
- stable: `sparseml <https://pypi.org/project/sparseml />`_
87+
- nightly (dev): `sparseml-nightly <https://pypi.org/project/sparseml-nightly />`_
8888

8989
Additionally, more information can be found via
9090
`GitHub Releases <https://github.com/neuralmagic/sparseml/releases />`_.

sparseml/_sources/recipes.md.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ The files are written in [YAML](https://yaml.org/) and stored in YAML or
2525
The rest of the SparseML system is coded to parse the recipe files into a native format for the desired framework
2626
and apply the modifications to the model and training pipeline.
2727

28+
In a recipe, modifiers must be written in a list that includes "modifiers" in its name.
29+
2830
The easiest ways to get or create optimization recipes are by either using
2931
the pre-configured recipes in [SparseZoo](https://github.com/neuralmagic/sparsezoo) or
3032
using [Sparsify's](https://github.com/neuralmagic/sparsify) autoML style creation.

sparseml/index.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ <h1>SparseML 0.1<a class="headerlink" href="#sparseml-version" title="Permalink
205205
</div><div class="section" id="overview">
206206
<h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline"></a></h2>
207207
<p>SparseML is a toolkit that includes APIs, CLIs, scripts and libraries that apply state-of-the-art optimization
208-
algorithms such as <a class="reference external" href="https://neuralmagic.com/blog/pruning-overview//">pruning</a> and
208+
algorithms such as <a class="reference external" href="https://neuralmagic.com/blog/pruning-overview/">pruning</a> and
209209
<a class="reference external" href="https://arxiv.org/abs/1609.07061/">quantization</a> to any neural network.
210210
General, recipe-driven approaches built around these optimizations enable the simplification of creating faster
211211
and smaller models for the ML performance community at large.</p>
212-
<p>SparseML is integrated for easy model optimizations within the <a class="reference external" href="https://pytorch.org//">PyTorch</a>,
213-
<a class="reference external" href="https://keras.io//">Keras</a>, and <a class="reference external" href="http://tensorflow.org//">TensorFlow V1</a> ecosystems currently.</p>
212+
<p>SparseML is integrated for easy model optimizations within the <a class="reference external" href="https://pytorch.org/">PyTorch</a>,
213+
<a class="reference external" href="https://keras.io/">Keras</a>, and <a class="reference external" href="http://tensorflow.org/">TensorFlow V1</a> ecosystems currently.</p>
214214
</div>
215215
<div class="section" id="related-products">
216216
<h2>Related Products<a class="headerlink" href="#related-products" title="Permalink to this headline"></a></h2>
@@ -227,19 +227,19 @@ <h2>Related Products<a class="headerlink" href="#related-products" title="Permal
227227
<div class="section" id="resources-and-learning-more">
228228
<h2>Resources and Learning More<a class="headerlink" href="#resources-and-learning-more" title="Permalink to this headline"></a></h2>
229229
<ul class="simple">
230-
<li><p><a class="reference external" href="https://docs.neuralmagic.com/sparsezoo//">SparseZoo Documentation</a></p></li>
231-
<li><p><a class="reference external" href="https://docs.neuralmagic.com/sparsify//">Sparsify Documentation</a></p></li>
232-
<li><p><a class="reference external" href="https://docs.neuralmagic.com/deepsparse//">DeepSparse Documentation</a></p></li>
233-
<li><p><a class="reference external" href="https://www.neuralmagic.com/blog//">Neural Magic Blog</a>,
234-
<a class="reference external" href="https://www.neuralmagic.com/resources//">Resources</a>,
235-
<a class="reference external" href="https://www.neuralmagic.com//">Website</a></p></li>
230+
<li><p><a class="reference external" href="https://docs.neuralmagic.com/sparsezoo/">SparseZoo Documentation</a></p></li>
231+
<li><p><a class="reference external" href="https://docs.neuralmagic.com/sparsify/">Sparsify Documentation</a></p></li>
232+
<li><p><a class="reference external" href="https://docs.neuralmagic.com/deepsparse/">DeepSparse Documentation</a></p></li>
233+
<li><p><a class="reference external" href="https://www.neuralmagic.com/blog/">Neural Magic Blog</a>,
234+
<a class="reference external" href="https://www.neuralmagic.com/resources/">Resources</a>,
235+
<a class="reference external" href="https://www.neuralmagic.com/">Website</a></p></li>
236236
</ul>
237237
</div>
238238
<div class="section" id="release-history">
239239
<h2>Release History<a class="headerlink" href="#release-history" title="Permalink to this headline"></a></h2>
240240
<p>Official builds are hosted on PyPi
241-
- stable: <a class="reference external" href="https://pypi.org/project/sparseml//">sparseml</a>
242-
- nightly (dev): <a class="reference external" href="https://pypi.org/project/sparseml-nightly//">sparseml-nightly</a></p>
241+
- stable: <a class="reference external" href="https://pypi.org/project/sparseml/">sparseml</a>
242+
- nightly (dev): <a class="reference external" href="https://pypi.org/project/sparseml-nightly/">sparseml-nightly</a></p>
243243
<p>Additionally, more information can be found via
244244
<a class="reference external" href="https://github.com/neuralmagic/sparseml/releases/">GitHub Releases</a>.</p>
245245
<div class="toctree-wrapper compound">

sparseml/recipes.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ <h1>Optimization Recipes<a class="headerlink" href="#optimization-recipes" title
226226
<a class="reference external" href="https://assemble.io/docs/YAML-front-matter.html">YAML front matter</a>.
227227
The rest of the SparseML system is coded to parse the recipe files into a native format for the desired framework
228228
and apply the modifications to the model and training pipeline.</p>
229+
<p>In a recipe, modifiers must be written in a list that includes “modifiers” in its name.</p>
229230
<p>The easiest ways to get or create optimization recipes are by either using
230231
the pre-configured recipes in <a class="reference external" href="https://github.com/neuralmagic/sparsezoo">SparseZoo</a> or
231232
using <a class="reference external" href="https://github.com/neuralmagic/sparsify">Sparsify’s</a> autoML style creation.</p>

sparseml/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)