Unverified Commit 2c45efc3 authored by Liang Bowen's avatar Liang Bowen Committed by GitHub
Browse files

html refactor (#555)

parent d1211148
colossalai.zero.sharded\_optim
==============================
===============================
.. automodule:: colossalai.zero.sharded_optim
:members:
.. toctree::
:maxdepth: 2
colossalai.zero.sharded_optim.bookkeeping
.. toctree::
:maxdepth: 2
colossalai.zero.sharded_optim.sharded_optim
colossalai.zero.sharded_optim.sharded_optim_v2
colossalai.zero.sharded\_optim.sharded\_optim
=============================================
.. automodule:: colossalai.zero.sharded_optim.sharded_optim
:members:
colossalai.zero.sharded\_optim.sharded\_optim\_v2
=================================================
.. automodule:: colossalai.zero.sharded_optim.sharded_optim_v2
:members:
......@@ -3,10 +3,3 @@ colossalai.zero.sharded\_param
.. automodule:: colossalai.zero.sharded_param
:members:
.. toctree::
:maxdepth: 2
colossalai.zero.sharded_param.sharded_param
colossalai.zero.sharded_param.sharded_tensor
colossalai.zero.sharded\_param.sharded\_param
=============================================
.. automodule:: colossalai.zero.sharded_param.sharded_param
:members:
colossalai.zero.sharded\_param.sharded\_tensor
==============================================
.. automodule:: colossalai.zero.sharded_param.sharded_tensor
:members:
colossalai.zero.sharded\_utils
===============
.. automodule:: colossalai.zero.sharded_utils
:members:
\ No newline at end of file
......@@ -16,12 +16,6 @@ import sys
sys.path.insert(0, os.path.abspath('..'))
def get_version():
with open('../version.txt') as f:
return f.read().strip()
# -- Project information -----------------------------------------------------
project = 'Colossal-AI'
......@@ -29,7 +23,8 @@ copyright = f'{datetime.datetime.now().year}, HPC-AI Tech'
author = 'HPC-AI Technology Inc.'
# The full version, including alpha/beta/rc tags
release = get_version()
release = '0.0.1'
# -- General configuration ---------------------------------------------------
......@@ -40,6 +35,7 @@ extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.linkcode',
'myst_parser',
]
......@@ -51,7 +47,9 @@ autodoc_typehints = 'none'
# Enable overriding of function signatures in the first line of the docstring.
autodoc_docstring_signature = True
autodoc_default_options = {'member-order': 'bysource'}
autodoc_default_options = {
'member-order': 'bysource',
}
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
......@@ -69,7 +67,7 @@ exclude_patterns = ['.build', 'Thumbs.db', '.DS_Store']
html_theme = 'sphinx_rtd_theme'
html_show_sourcelink = False
html_theme_options = {
'navigation_depth': 2,
'navigation_depth': 3,
}
html_context = {
......@@ -90,3 +88,48 @@ html_css_files = [
# -- Extension configuration -------------------------------------------------
source_suffix = ['.rst', '.md', '.MD']
import inspect
import colossalai
def linkcode_resolve(domain, info):
"""
Determine the URL corresponding to Python object
"""
if domain != 'py':
return None
modname = info['module']
fullname = info['fullname']
submod = sys.modules.get(modname)
if submod is None:
return None
obj = submod
for part in fullname.split('.'):
try:
obj = getattr(obj, part)
except Exception:
return None
try:
fn = inspect.getsourcefile(obj)
except Exception:
fn = None
if not fn:
return None
try:
source, lineno = inspect.findsource(obj)
except Exception:
lineno = None
if lineno:
linespec = "#L%d" % (lineno + 1)
else:
linespec = ""
fn = os.path.relpath(fn, start=os.path.dirname(colossalai.__file__))
github = "https://github.com/hpcaitech/ColossalAI/blob/main/colossalai/{}{}"
return github.format(fn, linespec)
......@@ -5,14 +5,23 @@
Colossal-AI API documentation
======================================
.. toctree::
:maxdepth: 2
:caption: API REFERENCE
colossalai/colossalai
.. toctree::
:maxdepth: 2
:caption: Useful links for Colossal-AI
links/Colossalai examples
links/Colossalai benchmarks
links/Colossalai tutorial
Indices and tables
==================
--------------------
* :ref:`genindex`
Colossal-AI Github Homepage
==================================
*If you are looking for the Git homepage of Colossal-AI, please check*
`Colossal-AI Tutorial <https://github.com/hpcaitech/ColossalAI>`_
*for our source code.*
\ No newline at end of file
Colossal-AI Benchmarks
==================================
*If you are interested in the performance or the features of Colossal-AI, please check*
`Colossal-AI Benchmark <https://github.com/hpcaitech/ColossalAI-Benchmark>`_.
*to get more details about our performance on CIFAR10, ImageNet1K or GPT2 ZeRO.*
\ No newline at end of file
Colossal-AI Examples
==================================
*If you are looking for the example code of using Colossal-AI in CV or NLP, please check*
`Colossal-AI Example <https://github.com/hpcaitech/ColossalAI-Examples>`_
*to get more details about using colossalai in Resnet, Moe, Vit, Bert and GPT*
\ No newline at end of file
Colossal-AI Tutorial
==================================
*If you are looking for the tutorial of using Colossal-AI, please check*
`Colossal-AI Tutorial <https://www.colossalai.org/docs/get_started/installation>`_
*to get more details about getting started, using TP (tensor parallel), PP (pipeline parallel)
and training with colossalai trainer or engine.*
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment