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

[Docs] Readthedocs ZH #553

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b598b36
[Docs] Readthedocs (#304)
pppppM Jan 10, 2024
ff60399
[Fix] Support ZH Readthedocs (#305)
pppppM Jan 10, 2024
55d8424
update conf.py
pppppM Jan 10, 2024
b1d76e0
[Docs] Document optimization (#362)
crazysteeaam Jan 26, 2024
1505301
[Docs] Update Docs docs/en/get_started/installation.md (#364)
JimmyMa99 Feb 28, 2024
d994fb6
[Docs] Refine Quick Start (#378)
fanqiNO1 Mar 6, 2024
7e07bf9
Update overview.md (#412)
Jianfeng777 Mar 6, 2024
c360cb8
Merge branch 'main' into 'docs' (#463)
LZHgrla Mar 11, 2024
d01b5e6
[Docs] Add `docs/zh_cn/preparation/pretrained_model.md` (#462)
LZHgrla Mar 26, 2024
7dfab43
[Docs] Add `docs/zh_cn/training/multi_modal_dataset.md` (#503)
LZHgrla Mar 26, 2024
a322df4
[Docs] Improve readthedocs style (#545)
LZHgrla Apr 3, 2024
60060c2
[Docs] `.md` to `.rst` (#544)
LZHgrla Apr 9, 2024
0789534
[Docs] Add `docs/zh_cn/training/custom_pretrain_dataset.rst` (#535)
LZHgrla Apr 9, 2024
7d5bd74
[Docs] Add docs about training on large scale dataset (#517)
HIT-cwh Apr 9, 2024
efa906d
[Docs] Add internevo migration related documents (#506)
HIT-cwh Apr 9, 2024
374e854
[Docs] Add `docs/zh_cn/training/modify_settings.rst` (#490)
LZHgrla Apr 9, 2024
8db28af
[Docs] Add `length_grouped_sampler.rst` (#511)
LZHgrla Apr 9, 2024
ea6f03c
[Docs] Add accelerate related (#504)
HIT-cwh Apr 9, 2024
a30aa79
[Docs] Add visualization docs (#516)
HIT-cwh Apr 9, 2024
980dfcc
[Docs] Add docs about SFT with custom dataset (#514)
HIT-cwh Apr 9, 2024
ceee23f
[Docs] Add `docs/zh_cn/training/open_source_dataset.rst` (#502)
LZHgrla Apr 9, 2024
636004d
[Docs] Add `docs/zh_cn/preparation/prompt_template.rst` (#475)
LZHgrla Apr 9, 2024
f711a19
[Docs] Add Sequence Parallel documents (#505)
HIT-cwh Apr 9, 2024
3678629
Merge branch 'main' into docs
pppppM Apr 9, 2024
8b1e997
[Docs] Update `docs/zh_cn` outline (#556)
LZHgrla Apr 10, 2024
f125a89
[Docs] Update `docs/en` theme (#557)
LZHgrla Apr 10, 2024
582a398
[Docs] Add tokenizer to sft in Case 2 (#584)
HIT-cwh Apr 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/en/.readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.8"

formats:
- epub

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

sphinx:
configuration: docs/en/conf.py
20 changes: 20 additions & 0 deletions docs/en/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
6 changes: 6 additions & 0 deletions docs/en/_static/css/readthedocs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.header-logo {
background-image: url("../image/logo.png");
background-size: 177px 40px;
height: 40px;
width: 177px;
}
Binary file added docs/en/_static/image/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/en/acceleration/benchmark.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Benchmark
=========
2 changes: 2 additions & 0 deletions docs/en/acceleration/deepspeed.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DeepSpeed
=========
2 changes: 2 additions & 0 deletions docs/en/acceleration/flash_attn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Flash Attention
===============
2 changes: 2 additions & 0 deletions docs/en/acceleration/hyper_parameters.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
HyperParameters
===============
2 changes: 2 additions & 0 deletions docs/en/acceleration/length_grouped_sampler.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Length Grouped Sampler
======================
2 changes: 2 additions & 0 deletions docs/en/acceleration/pack_to_max_length.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Pack to Max Length
==================
2 changes: 2 additions & 0 deletions docs/en/acceleration/train_extreme_long_sequence.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Train Extreme Long Sequence
===========================
2 changes: 2 additions & 0 deletions docs/en/acceleration/train_large_scale_dataset.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Train Large-scale Dataset
=========================
2 changes: 2 additions & 0 deletions docs/en/acceleration/varlen_flash_attn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Varlen Flash Attention
======================
1 change: 1 addition & 0 deletions docs/en/chat/agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Chat with Agent
1 change: 1 addition & 0 deletions docs/en/chat/llm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Chat with LLM
1 change: 1 addition & 0 deletions docs/en/chat/lmdeploy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Accelerate chat by LMDeploy
1 change: 1 addition & 0 deletions docs/en/chat/vlm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Chat with VLM
109 changes: 109 additions & 0 deletions docs/en/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.

import os
import sys

from sphinx.ext import autodoc

sys.path.insert(0, os.path.abspath('../..'))

# -- Project information -----------------------------------------------------

project = 'XTuner'
copyright = '2024, XTuner Contributors'
author = 'XTuner Contributors'

# The full version, including alpha/beta/rc tags
version_file = '../../xtuner/version.py'
with open(version_file) as f:
exec(compile(f.read(), version_file, 'exec'))
__version__ = locals()['__version__']
# The short X.Y version
version = __version__
# The full version, including alpha/beta/rc tags
release = __version__

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx.ext.intersphinx',
'sphinx_copybutton',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'myst_parser',
'sphinxarg.ext',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# Exclude the prompt "$" when copying code
copybutton_prompt_text = r'\$ '
copybutton_prompt_is_regexp = True

language = 'en'

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_book_theme'
html_logo = '_static/image/logo.png'
html_theme_options = {
'path_to_docs': 'docs/en',
'repository_url': 'https://github.com/InternLM/xtuner',
'use_repository_button': True,
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']

# Mock out external dependencies here.
autodoc_mock_imports = [
'cpuinfo',
'torch',
'transformers',
'psutil',
'prometheus_client',
'sentencepiece',
'vllm.cuda_utils',
'vllm._C',
'numpy',
'tqdm',
]


class MockedClassDocumenter(autodoc.ClassDocumenter):
"""Remove note about base class when a class is derived from object."""

def add_line(self, line: str, source: str, *lineno: int) -> None:
if line == ' Bases: :py:class:`object`':
return
super().add_line(line, source, *lineno)


autodoc.ClassDocumenter = MockedClassDocumenter

navigation_with_keys = False
1 change: 1 addition & 0 deletions docs/en/evaluation/hook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Evaluation during training
1 change: 1 addition & 0 deletions docs/en/evaluation/mmbench.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# MMBench (VLM)
1 change: 1 addition & 0 deletions docs/en/evaluation/mmlu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# MMLU (LLM)
1 change: 1 addition & 0 deletions docs/en/evaluation/opencompass.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Evaluate with OpenCompass
52 changes: 52 additions & 0 deletions docs/en/get_started/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
### Installation

In this section, we will show you how to install XTuner.

## Installation Process

We recommend users to follow our best practices for installing XTuner.
It is recommended to use a conda virtual environment with Python-3.10 to install XTuner.

### Best Practices

**Step 0.** Create a Python-3.10 virtual environment using conda.

```shell
conda create --name xtuner-env python=3.10 -y
conda activate xtuner-env
```

**Step 1.** Install XTuner.

Case a: Install XTuner via pip:

```shell
pip install -U xtuner
```

Case b: Install XTuner with DeepSpeed integration:

```shell
pip install -U 'xtuner[deepspeed]'
```

Case c: Install XTuner from the source code:

```shell
git clone https://github.com/InternLM/xtuner.git
cd xtuner
pip install -e '.[all]'
# "-e" indicates installing the project in editable mode, so any local modifications to the code will take effect without reinstalling.
```

## Verify the installation

To verify if XTuner is installed correctly, we will use a command to print the configuration files.

**Print Configuration Files:** Use the command `xtuner list-cfg` in the command line to verify if the configuration files can be printed.

```shell
xtuner list-cfg
```

You should see a list of XTuner configuration files, corresponding to the ones in [xtuner/configs](https://github.com/InternLM/xtuner/tree/main/xtuner/configs) in the source code.
5 changes: 5 additions & 0 deletions docs/en/get_started/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Overview

This chapter introduces you to the framework and workflow of XTuner, and provides detailed tutorial links.

## What is XTuner