Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganizing the documentation for Quark v0.2.0 #22

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions docs/apis.rst

This file was deleted.

32 changes: 0 additions & 32 deletions docs/example_gen.rst

This file was deleted.

14 changes: 0 additions & 14 deletions docs/getting_started.rst

This file was deleted.

35 changes: 26 additions & 9 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,33 @@ Welcome to Quark's documentation!

.. toctree::
:maxdepth: 1

What's New <whats_new.rst>
Quark Overview <quark_overview.rst>
:caption: Release Notes

Release V0.2.0 <release_note.rst>

.. toctree::
:maxdepth: 1
:caption: Getting Started

Installation <install.rst>
Getting Started <getting_started.rst>
Highlight Features <highlight_features.rst>
User Guide <user_guide.rst>
APIs <apis.rst>
Examples <example.rst>
Release Note <release_note.rst>
Quark Overview <quark_overview.rst>

.. toctree::
:maxdepth: 1
:caption: PyTorch

Quark with PyTorch <pytorch_overview.rst>

.. toctree::
:maxdepth: 1
:caption: ONNX

Quark with ONNX <onnx_overview.rst>

.. toctree::
:maxdepth: 1
:caption: FAQ

FAQ <faq.rst>

..
Expand Down
20 changes: 20 additions & 0 deletions docs/onnx/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Quark with ONNX!
===================

.. toctree::
:maxdepth: 1

Getting Started <getting_started.rst>
User Guide <user_guide.rst>
Examples <onnx_examples.rst>
APIs <onnx_apis.rst>
Advanced Features <onnx_adv_features.rst>

..
------------

#####################################
License
#####################################

Quark is licensed under MIT License. Refer to the LICENSE file for the full license text and copyright notice.
20 changes: 20 additions & 0 deletions docs/onnx/onnx_adv_features.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Advanced Features
==================

This page introduces some key features of Quark. Please refere to the
`user guide <./user_guide.html>`__ for the more details of other features
of Quark.


Quark for ONNX
--------------

- `AdaRound and AdaQuant <./tutorial_adaround_adaquant.html>`__
- `Mixed Precision <./tutorial_mix_precision.html>`__

.. raw:: html

<!--
## License
Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. SPDX-License-Identifier: MIT
-->
24 changes: 24 additions & 0 deletions docs/onnx/onnx_apis.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Quark APIs for ONNX
===================

**User facing APIs:**

.. toctree::
:maxdepth: 2

Quantization <../autoapi/quark/onnx/quantization/api/index.rst>
Optimization <../autoapi/quark/onnx/optimize/index.rst>
Calibration <../autoapi/quark/onnx/calibrate/index.rst>
ONNX Quantizer <../autoapi/quark/onnx/onnx_quantizer/index.rst>
QDQ Quantizer <../autoapi/quark/onnx/qdq_quantizer/index.rst>
Configuration <../autoapi/quark/onnx/quantization/config/config/index.rst>
Quantization Utilities <../autoapi/quark/onnx/quant_utils/index.rst>

..
------------

#####################################
License
#####################################

Quark is licensed under MIT License. Refer to the LICENSE file for the full license text and copyright notice.
13 changes: 1 addition & 12 deletions docs/example.rst → docs/onnx/onnx_examples.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
Examples
========

Quark for Pytorch
-----------------

* `Language Model Quantization & Export <./quark_example_torch_llm_gen.html>`__
* `Diffusion Model Quantization & Export <./quark_example_torch_diffusers_gen.html>`__
* `Vision Model Quantization using Quark FX Graph Mode <./quark_example_torch_vision_gen.html>`__
* `Extension for Pytorch-light (AMD internal project) <./quark_example_torch_pytorch_light_gen.html>`__
* `Extension for Brevitas <./quark_example_torch_brevitas_gen.html>`__


Quark for ONNX
--------------
Examples to run Quark for ONNX.

* `Image Classification Quantization <./quark_example_onnx_image_classification_gen.html>`__
* `Fast Finetune AdaRound <./quark_examples_onnx_adaround_gen.html>`__
Expand Down
27 changes: 27 additions & 0 deletions docs/onnx/user_guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Quark for ONNX
==============

There are several steps to quantize a floating-point model with
``Quark for ONNX``:

1. Load original float model
2. Set quantization configuration
3. Define datareader
4. Use the Quark API to perform in-place replacement of the model's modules with quantized module.

More details:

* `Configuring Quark for ONNX <./user_guide_config_description.html>`__
* `Adding Calibration Datasets <./user_guide_datareader.html>`__
* `Feature Description <./user_guide_feature_description.html>`__
* `Supported Datatype and OpType <./user_guide_supported_optype_datatype.html>`__
* `Accuracy Improvement <./user_guide_accuracy_improvement.html>`__
* `Optional Utilities <./user_guide_optional_utilities.html>`__
* `Tools <./user_guide_tools.html>`__

.. raw:: html

<!--
## License
Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. SPDX-License-Identifier: MIT
-->
19 changes: 19 additions & 0 deletions docs/onnx_overview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ONNX
====

.. toctree::
:maxdepth: 1

Getting Started <onnx/getting_started.rst>
User Guide <onnx/user_guide.rst>
Examples <onnx/onnx_examples.rst>
APIs <onnx/onnx_apis.rst>
Advanced Features <onnx/onnx_adv_features.rst>


.. raw:: html

<!--
## License
Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. SPDX-License-Identifier: MIT
-->
23 changes: 23 additions & 0 deletions docs/pytorch/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Quark with PyTorch!
===================

**Quark** is a deep learning model quantization toolkit for quantizing models from PyTorch, ONNX and other frameworks.
It provides easy-to-use APIs for quantization and more advanced features than native frameworks, in support for multiple HW backends.

.. toctree::
:maxdepth: 1

Getting Started <getting_started.rst>
User Guide <user_guide.rst>
Examples <pytorch_examples.rst>
APIs <pytorch_apis.rst>
Advanced Features <pytorch_adv_features.rst>

..
------------

#####################################
License
#####################################

Quark is licensed under MIT License. Refer to the LICENSE file for the full license text and copyright notice.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Highlight Features
Advanced Features
==================

This page introduces some key features of Quark. Please refere to the
Expand All @@ -8,14 +8,10 @@ of Quark.
Quark for PyTorch
-----------------

- `Bridge from Quark to llama.cpp <./pytorch/tutorial_gguf.html>`__
- `Using MX (Microscaling) with Quark <./pytorch/tutorial_mx.html>`__
- `Bridge from Quark to llama.cpp <./tutorial_gguf.html>`__
- `Using MX (Microscaling) with Quark <./tutorial_mx.html>`__

Quark for ONNX
--------------

- `AdaRound and AdaQuant <./onnx/tutorial_adaround_adaquant.html>`__
- `Mixed Precision <./onnx/tutorial_mix_precision.html>`__
.. raw:: html

<!--
Expand Down
21 changes: 21 additions & 0 deletions docs/pytorch/pytorch_apis.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Quark APIs for PyTorch
======================

**User facing APIs:**

.. toctree::
:maxdepth: 1

Quantization <../autoapi/quark/torch/quantization/api/index.rst>
Export <../autoapi/quark/torch/export/api/index.rst>
Quantizer Configuration <../autoapi/quark/torch/quantization/config/config/index.rst>
Exporter Configuration <../autoapi/quark/torch/export/config/config/index.rst>

..
------------

#####################################
License
#####################################

Quark is licensed under MIT License. Refer to the LICENSE file for the full license text and copyright notice.
18 changes: 18 additions & 0 deletions docs/pytorch/pytorch_examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Examples
========

Examples to run Quark for Pytorch.

* `Language Model Quantization & Export <./quark_example_torch_llm_gen.html>`__
* `Diffusion Model Quantization & Export <./quark_example_torch_diffusers_gen.html>`__
* `Vision Model Quantization using Quark FX Graph Mode <./quark_example_torch_vision_gen.html>`__
* `Extension for Pytorch-light (AMD internal project) <./quark_example_torch_pytorch_light_gen.html>`__
* `Extension for Brevitas <../quark_example_torch_brevitas_gen.html>`__


.. raw:: html

<!--
## License
Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. SPDX-License-Identifier: MIT
-->
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Run with SDXL Without Quantization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Run original SDXL:

--------------------------------------

.. code::
Expand All @@ -51,6 +52,7 @@ Calibration and Export SafeTensor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Run Calibration:

--------------------------------------

.. code::
Expand All @@ -61,16 +63,18 @@ Load SafeTensor and Test
~~~~~~~~~~~~~~~~~~~~~~~~

- Load and Test:

--------------------------------------

.. code::

python quantize_sdxl.py --input_scheme {'per-tensor'} --weight_scheme {'per-tensor', 'per-channel'} --test_data_tsv_file_path {your calibration dataset file path} --load --test

Load SafeTensor and Run with a prompt
~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Load and Run:

--------------------------------------

.. code::
Expand Down
Loading