diff --git a/Docs/CMakeLists.txt b/Docs/CMakeLists.txt index 598aa2fc935..43afb34fbcc 100644 --- a/Docs/CMakeLists.txt +++ b/Docs/CMakeLists.txt @@ -52,23 +52,5 @@ add_custom_target(doc add_dependencies(doc copy_doc_source copy_examples) -# Only build torch v2 documentation if torch is enabled -if(ENABLE_TORCH) - # Separate build for v2 documentation - # This prevents v1 documents from appearing in the TOC and search results of the v2 documentation - # Specify the config file for the v2 docs as Docs/torch_docs instead of the default source path - add_custom_target(doc_v2 - COMMAND ${CMAKE_COMMAND} -E env - "${AIMET_PYTHONPATH}" - "SW_VERSION=${SW_VERSION}" - sphinx-build -v -T -b html ${CMAKE_BINARY_DIR}/Docs_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/torch_v2 -c ${CMAKE_BINARY_DIR}/Docs_SOURCE/torch_docs) - - add_dependencies(doc_v2 - copy_doc_source) - - add_dependencies(doc - doc_v2) -endif(ENABLE_TORCH) - add_custom_target(copy_doc_source COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/Docs_SOURCE) diff --git a/Docs/_static/style.css b/Docs/_static/style.css index 1d74b8854c2..dd30c3fa814 100644 --- a/Docs/_static/style.css +++ b/Docs/_static/style.css @@ -221,37 +221,6 @@ padding: .4045em 1.618em; font-size: 14px; } - -/* - * Version selector color configuration - */ -.rst-versions { - position: sticky; - background: var(--aimet-white); -} - -.rst-versions .rst-current-version { - text-align: center; - background-color: var(--aimet-white); - color: black; -} - -.rst-versions .rst-current-version-name { - color: var(--aimet-menu-font-active); -} - -.rst-versions .rst-current-version .fa-caret-down { - color: black; -} - -.rst-versions .rst-other-versions dd a { - color: var(--aimet-menu-font-active) -} - -.rst-versions .rst-other-versions dt { - color: black; -} - /* * Highlight color for code segments */ diff --git a/Docs/_templates/layout.html b/Docs/_templates/layout.html deleted file mode 100644 index 54f72c20ce3..00000000000 --- a/Docs/_templates/layout.html +++ /dev/null @@ -1,32 +0,0 @@ -{% extends "!layout.html" %} - -{%- block sidebartitle %} - - {# the logo helper function was removed in Sphinx 6 and deprecated since Sphinx 4 #} - {# the master_doc variable was renamed to root_doc in Sphinx 4 (master_doc still exists in later Sphinx versions) #} - {%- set _logo_url = logo_url|default(pathto('_static/' + (logo or ""), 1)) %} - {%- set _root_doc = root_doc|default(master_doc) %} - - {% if not theme_logo_only %}{{ project }}{% endif %} - {%- if logo or logo_url %} - - {%- endif %} - - - {%- if theme_display_version %} - {%- set nav_version = version %} - {%- if READTHEDOCS and current_version %} - {%- set nav_version = current_version %} - {%- endif %} - {%- if nav_version %} -
- {{ nav_version }} -
- {%- endif %} - {%- endif %} - - {%- include "variants.html" %} - - {%- include "searchbox.html" %} - -{%- endblock %} diff --git a/Docs/_templates/variants.html b/Docs/_templates/variants.html deleted file mode 100644 index f49723cfe2f..00000000000 --- a/Docs/_templates/variants.html +++ /dev/null @@ -1,17 +0,0 @@ -{% if display_version_tab %} -{# Add rst-badge after rst-versions for small badge style. #} -
- - AIMET Variant: {{ current_version }} - - -
-
-
{{ _('Documentation Versions') }}
- {% for slug, url in versions %} -
{{ slug }}
- {% endfor %} -
-
-
-{% endif %} diff --git a/Docs/conf.py b/Docs/conf.py index 642d18f97ab..ec421d5ff5f 100644 --- a/Docs/conf.py +++ b/Docs/conf.py @@ -233,16 +233,6 @@ def setup(app): nbsphinx_allow_errors = True nbsphinx_execute = 'never' -docs_root_url = "https://quic.github.io/aimet-pages/releases/latest/" - -# Version here refers to the AIMET torch v1/v2 version, not the AIMET release number -html_context = { - 'current_version' : "Universal", - 'versions' : [["Universal", docs_root_url + "user_guide/index.html"], - ["PyTorch", docs_root_url + "torch_v2/torch_docs/index.html"]], - 'display_version_tab': False -} - autosummary_generate = False # contains a list of modules to be mocked up which are not available during docs build time diff --git a/Docs/torch_docs/conf.py b/Docs/torch_docs/conf.py deleted file mode 100644 index fece0ba41f3..00000000000 --- a/Docs/torch_docs/conf.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -# pylint: skip-file -# ============================================================================= -# @@-COPYRIGHT-START-@@ -# -# Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# SPDX-License-Identifier: BSD-3-Clause -# -# @@-COPYRIGHT-END-@@ -# ============================================================================= -""" Configuration file for the Sphinx documentation builder """ - -import os -import sys - - -cur_dir = os.getcwd() -source_dir = os.path.join(cur_dir, '..') -sys.path.append(os.path.join(cur_dir, '..')) - -# First import all universal settings from the base Docs/conf.py file -from conf import * - -# Overwrite the master document and exclude irrelevant files from the build -master_doc = 'torch_docs/index' - -# These paths are relative to the source directory -exclude_patterns = ["keras_code_examples*", "onnx_code_examples*", "tf_code_examples*", "torch_code_examples*", - "api_docs*", "Examples*", "user_guide/examples.rst"] - -# These paths are relative to the current directory -html_static_path = [os.path.join(source_dir, "_static")] -templates_path = [os.path.join(source_dir, "_templates")] -html_logo = '../images/brain_logo.png' - -# Version here refers to the AIMET torch v1/v2 version, not the AIMET release number -html_context["current_version"] = "PyTorch" - -autosummary_generate = True - -autosummary_filename_map = { - "aimet_torch.v2.quantization.affine.quantize": "aimet_torch.v2.quantization.affine.quantize_" -} diff --git a/Docs/torch_docs/index.rst b/Docs/torch_docs/index.rst deleted file mode 100644 index 3224374d212..00000000000 --- a/Docs/torch_docs/index.rst +++ /dev/null @@ -1,105 +0,0 @@ - -.. _ug-torch-apidocs: - -================================================ -AIMET: AI Model Efficiency Toolkit Documentation -================================================ - -AI Model Efficiency Toolkit (AIMET) provides tools enabling users to quantize and compress PyTorch models. Quantization -is an essential step when deploying models to edge devices with fixed-point AI accelerators. - -AIMET provides both post-training and fine-tuning techniques to minimize accuracy loss incurred when quantizing -floating-point models. - -.. image:: ../images/AIMET_index_no_fine_tune.png - :width: 800px - -The above picture shows a high-level view of the workflow when using AIMET. The user passes a trained floating-point -model to AIMET's APIs for quantization. AIMET returns a new PyTorch model simulating low-precision inference, which users -can fine-tune to recover lost accuracy. Users can then export the quantized model via ONNX/torchscript to an on-target -runtime like Qualcomm\ |reg| Neural Processing SDK. - - -Getting Started -=============== - - -.. toctree:: - :caption: Getting Started - :hidden: - :titlesonly: - :includehidden: - :maxdepth: 1 - - Installation <../install/index> - Quickstart Guide - - -**Pip Installation:** - -.. code-block:: console - - apt-get install liblapacke - python3 -m pip install aimet-torch - -For more installation options, please visit the :ref:`AIMET installation instructions`. - - -**Basic Usage:** - -.. code-block:: Python - - import aimet_torch.v2 as aimet - - # Create quantization simulation model for your model - sim = aimet.quantsim.QuantizationSimModel(model, sample_input) - - # Calibrate quantization encodings on sample data - with aimet.nn.compute_encodings(sim.model): - for data, _ in data_loader: - sim.model(data) - - # Simulate quantized inference - sample_output = sim.model(sample_input) - - # Export model and quantization encodings - sim.export("./out_dir", "quantized_model", sample_input) - -Please view the :ref:`Quickstart Guide` for a more in-depth guide to using AIMET quantsim. - -.. toctree:: - :caption: Examples - :glob: - :titlesonly: - - examples/* - - - - -.. toctree:: - :caption: Feature Descriptions - :titlesonly: - :maxdepth: 1 - - Adaptive Rounding (AdaRound) <../user_guide/adaround> - -.. toctree:: - :maxdepth: 2 - :titlesonly: - :caption: AIMET PyTorch API - - quantized_modules - quantizer - api/nn.quantization_mixin - api/quantization/affine/index - api/quantization/float/index - encoding_analyzer - - - - -| |project| is a product of |author| -| Qualcomm\ |reg| Neural Processing SDK is a product of Qualcomm Technologies, Inc. and/or its subsidiaries. - -.. |reg| unicode:: U+000AE .. REGISTERED SIGN