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

Standardize documentation for ReadtheDocs #524

Merged
merged 2 commits into from
Jan 3, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/docs/.sphinx" # Location of package manifests
directory: "/docs/sphinx" # Location of package manifests
open-pull-requests-limit: 10
schedule:
interval: "daily"
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ _images/
_static/
_templates/
_toc.yml
docBin/

# matrices
*.csr
Expand Down
6 changes: 3 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ version: 2
sphinx:
configuration: docs/conf.py

formats: [htmlzip]
formats: [htmlzip, pdf, epub]

python:
install:
- requirements: docs/.sphinx/requirements.txt
- requirements: docs/sphinx/requirements.txt

build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.8"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Run the steps below to build documentation locally.
```bash
cd docs

pip3 install -r .sphinx/requirements.txt
pip3 install -r sphinx/requirements.txt

python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
```
Expand Down
4 changes: 2 additions & 2 deletions clients/gtest/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Gtest

hipblaslt-test is the main regression gtest for hipBLASLt. All test items should pass.

```
```shell
# Go to hipBLASLt build directory
cd hipBLASLt; cd build/release

Expand All @@ -13,5 +14,4 @@ cd hipBLASLt; cd build/release

# Demo: gtest tests with filter
./clients/staging/hipblaslt-test --gtest_filter=*quick*

```
2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
docBin
_build/
_doxygen/
1 change: 0 additions & 1 deletion docs/.sphinx/requirements.in

This file was deleted.

25 changes: 23 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,32 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html


import re

from rocm_docs import ROCmDocs

docs_core = ROCmDocs("hipBLASLt Documentation")
docs_core.run_doxygen()
with open('../CMakeLists.txt', encoding='utf-8') as f:
match = re.search(r'.*\bset\(VERSION_STRING\s+\"?([0-9.]+)[^0-9.]+', f.read())
if not match:
raise ValueError("VERSION not found!")
version_number = match[1]
left_nav_title = f"hipBLASLt {version_number} Documentation"

# for PDF output on Read the Docs
project = "hipBLASLt Documentation"
author = "Advanced Micro Devices, Inc."
copyright = "Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved."
version = version_number
release = version_number

external_toc_path = "./sphinx/_toc.yml"

docs_core = ROCmDocs(left_nav_title)
docs_core.run_doxygen(doxygen_root="doxygen", doxygen_path="doxygen/xml")
docs_core.setup()

external_projects_current_project = "hipblaslt"

for sphinx_var in ROCmDocs.SPHINX_VARS:
globals()[sphinx_var] = getattr(docs_core, sphinx_var)
2 changes: 1 addition & 1 deletion docs/datatypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ hipblasLtEpilogue_t
.. doxygenenum:: hipblasLtEpilogue_t

hipblasLtPointerMode_t
-------------------
----------------------
.. doxygenenum:: hipblasLtPointerMode_t

hipblasLtHandle_t
Expand Down
2 changes: 2 additions & 0 deletions docs/doxygen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
html/
xml/
6 changes: 3 additions & 3 deletions docs/.doxygen/Doxyfile → docs/doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = docBin
OUTPUT_DIRECTORY = .

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
Expand Down Expand Up @@ -963,7 +963,7 @@ FILTER_SOURCE_PATTERNS =
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.

USE_MDFILE_AS_MAINPAGE = ../README.md
# USE_MDFILE_AS_MAINPAGE = ../../README.md

#---------------------------------------------------------------------------
# Configuration options related to source browsing
Expand Down Expand Up @@ -2190,7 +2190,7 @@ HIDE_UNDOC_RELATIONS = YES
# set to NO
# The default value is: NO.

HAVE_DOT = YES
HAVE_DOT = NO

# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
Expand Down
2 changes: 1 addition & 1 deletion docs/ext-ops.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ hipBLASLtExt Operation Reference
********************************

hipBLASLtExt Operation API Reference
================================
====================================

hipblasltExtSoftmax()
------------------------------------------
Expand Down
16 changes: 8 additions & 8 deletions docs/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ Datatypes Supported:

hipblasLtMatmul supports the following computeType, scaleType, Atype/Btype, Ctype/Dtype and Bias Type:

======================= =================== ============= ==============
computeType scaleType/Bias Type Atype/Btype Ctype/Dtype
======================= =================== ============= ==============
HIPBLASLT_COMPUTE_F32 HIPBLASLT_R_32F HIPBLASLT_R_32F HIPBLASLT_R_32F
HIPBLASLT_COMPUTE_F32 HIPBLASLT_R_32F HIPBLASLT_R_16F HIPBLASLT_R_16F
HIPBLASLT_COMPUTE_F32 HIPBLASLT_R_32F HIPBLASLT_R_16F HIPBLASLT_R_32F
HIPBLASLT_COMPUTE_F32 HIPBLASLT_R_32F HIPBLASLT_R_16B HIPBLASLT_R_16B
======================= =================== ============= ==============
======================= =================== =============== ===============
computeType scaleType/Bias Type Atype/Btype Ctype/Dtype
======================= =================== =============== ===============
HIPBLASLT_COMPUTE_F32 HIPBLASLT_R_32F HIPBLASLT_R_32F HIPBLASLT_R_32F
HIPBLASLT_COMPUTE_F32 HIPBLASLT_R_32F HIPBLASLT_R_16F HIPBLASLT_R_16F
HIPBLASLT_COMPUTE_F32 HIPBLASLT_R_32F HIPBLASLT_R_16F HIPBLASLT_R_32F
HIPBLASLT_COMPUTE_F32 HIPBLASLT_R_32F HIPBLASLT_R_16B HIPBLASLT_R_16B
======================= =================== =============== ===============

hipblasLtMatrixTransformDescCreate()
------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ To overcome this overhead, it is recommended to query the heuristics once using


hipBLASLt Extensions
================
====================
See extension reference page for more information.
4 changes: 4 additions & 0 deletions docs/license.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
License
=======

.. include:: ../LICENSE.md
3 changes: 3 additions & 0 deletions docs/.sphinx/_toc.yml.in → docs/sphinx/_toc.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ subtrees:
- file: usage
- file: ext-ops
- file: clients
- caption: About
entries:
- file: license
1 change: 1 addition & 0 deletions docs/sphinx/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rocm-docs-core==0.30.3
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ pygments==2.15.0
# pydata-sphinx-theme
# sphinx
pyjwt[crypto]==2.6.0
# via
# pygithub
# pyjwt
# via pygithub
pynacl==1.5.0
# via pygithub
pytz==2023.3.post1
Expand Down
11 changes: 6 additions & 5 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ The following is a simple example of how this API works.
}

The base class (GemmInstance)
--------------
-----------------------------

This is the base class of class Gemm and GroupedGemm.

Expand All @@ -497,7 +497,7 @@ This is the base class of class Gemm and GroupedGemm.
HIPBLASLT_EXPORT hipblasStatus_t run(hipStream_t stream);

Get all algorithms
--------------
------------------

Get all algorithms lets users to get all the algorithms of a specific problem type. It requires the transpose of A, B, the data type of the inputs, and the compute type.

Expand Down Expand Up @@ -708,7 +708,7 @@ Grouped gemm
}

Algorithm Index
--------------
---------------

The extension API lets user to get the algorithm index from hipblasLtMatmulAlgo_t.

Expand All @@ -731,6 +731,7 @@ Example code
^^^^^^^^^^^^

.. code-block:: c++

int index = hipblaslt_ext::getIndexFromAlgo(testResults[i].algo);
// Save the index to disk or somewhere else for later use.

Expand All @@ -739,9 +740,8 @@ Example code
std::vector<hipblasLtMatmulHeuristicResult_t> heuristicResults;
CHECK_HIPBLASLT_ERROR(hipblaslt_ext::getAlgosFromIndex(handle, algoIndex, heuristicResults));


[Grouped Gemm] Fixed MK
--------------
-----------------------

hipBLASLt extension supports changing the sizes (m, n, k, batch) from the device memory "UserArguments", but the setup is a bit different from the normal routing.

Expand All @@ -751,6 +751,7 @@ Sum of n
A sum of N is required to use as an input for the grouped gemm instance.

.. code-block:: c++

{1000, 1, 1, 1}; // The array of N, the first element is the sum of N

// Below is the values stored in "UserArguments"
Expand Down