Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: InternLM/xtuner
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.23
Choose a base ref
...
head repository: InternLM/xtuner
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 14 commits
  • 833 files changed
  • 11 contributors

Commits on Jul 29, 2024

  1. readme中增加了MiniCPM的支持 (#869)

    Co-authored-by: liudan <[email protected]>
    LDLINGLINGLING and liudan authored Jul 29, 2024
    Copy the full SHA
    d2a173a View commit details

Commits on Jul 31, 2024

  1. [Bug] fix dsv2 attn dispatch (softmax_scale) (#873)

    fix dsv2 attn dispatch (softmax_scale)
    HIT-cwh authored Jul 31, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    01640b0 View commit details

Commits on Aug 9, 2024

  1. [Bug] fix openai_map_fn bugs (#885)

    fix openai_map_fn bugs
    HIT-cwh authored Aug 9, 2024
    Copy the full SHA
    7dd779b View commit details
  2. support transformers >= 4.43 (#878)

    HIT-cwh authored Aug 9, 2024
    Copy the full SHA
    d81b366 View commit details
  3. Add internlm2 5 cfgs (#872)

    * add internlm2.5 configs
    
    * limit transformers <= 4.42.4
    HIT-cwh authored Aug 9, 2024
    Copy the full SHA
    081c8ca View commit details

Commits on Sep 29, 2024

  1. [Bugs] fix qlora convert bugs (#930)

    fix qlora convert bugs
    HIT-cwh authored Sep 29, 2024
    Copy the full SHA
    4a1b201 View commit details

Commits on Oct 22, 2024

  1. 对Minicpm3进行了支持 (#954)

    * readme中增加了MiniCPM的支持
    
    * 适配了minicpm3,并且测试可以运行
    
    * 规范了格式,删除了长的行
    
    * delete the error file
    
    * fix lint
    
    * fix the file name error
    
    ---------
    
    Co-authored-by: liudan <[email protected]>
    LDLINGLINGLING and liudan authored Oct 22, 2024
    Copy the full SHA
    697bc77 View commit details

Commits on Nov 8, 2024

  1. Add functionality to download models from sources other than HuggingF…

    …ace (#946)
    
    support openmind model and dataset
    starmountain1997 authored Nov 8, 2024
    Copy the full SHA
    90192ff View commit details

Commits on Jan 14, 2025

  1. Add Ascend NPU as a backend (#983)

    Co-authored-by: 郑特驹 <[email protected]>
    Tonyztj and 郑特驹 authored Jan 14, 2025
    Copy the full SHA
    2c06115 View commit details
  2. [Feature]Support transformers==4.48 (#985)

    * update requirements
    
    * support internlm3, llama, mistral, mixtral, qwen2 and qwen2moe in transformers==4.48
    HIT-cwh authored Jan 14, 2025
    Copy the full SHA
    4ee8215 View commit details

Commits on Jan 21, 2025

  1. [Feature] Auto patch for different devices (#986)

    * [Feature] XTuner Lite (#974)
    
    * minimum dependency sft
    
    * fix dispatch
    
    * add timer
    
    * add tgs
    
    * internlm2 tp
    
    * rms support tp
    
    * gradient checkpointing
    
    * lazy load pretrain
    
    * temp
    
    * fix bugs
    
    * add data pipeline example
    
    * fix lints
    
    * remove useless code
    
    * fix hard pack bug
    
    * add comments
    
    * clean code
    
    * add shard strategy
    
    * support cpu offload
    
    * support cpu offload
    
    * trust remote code
    
    * fix soft packer bug
    
    * fix soft packer bug
    
    * fix soft packer bug
    
    * refactor data pipeline
    
    * fixup
    
    * fix pad tokens bug
    
    * check input_ids and labels
    
    * check input_ids and labels in collator
    
    * fix load local datasets bug
    
    * fix load cache datasts
    
    * restore dset order
    
    * save cached infos
    
    * accelerate start up
    
    * avoid all gather cached datasets
    
    * fixup
    
    * fix cache bug
    
    * Support group length (#4)
    
    * replace rmsnorm kernel
    
    * suport ftdp ds
    
    * suport load_bin
    
    * suport group by maxlen
    
    * add fsdp_ftdp_sft and fix fsdp_sft
    
    * suport ftdp ds
    
    * add lr min
    
    * fix bugs
    
    * fix bugs
    
    * delete
    
    * support llava
    
    * support packer cache
    
    * refactor dist load
    
    * Add sp tp (#5)
    
    * support sp and tp
    
    * add fsdp_tp_sft and modify fsdp_sft
    
    * move chat_template
    
    * fix load_ds
    
    * delete useless codes
    
    * delete useless codes
    
    * fix jsonl load
    
    * refactor
    
    * fix bug
    
    * fix lr scheduler
    
    * refactor setup parallel
    
    * update data load
    
    * fix bugs
    
    * move fsdp
    
    * adapt new parallel load
    
    * fix setup_parallel (#7)
    
    * fix some bugs
    
    * add remote codes
    
    * add convert script
    
    * support load image from ceph
    
    * support load image from ceph
    
    * fix cache dataset bugs
    
    * support mulit images
    
    * support llava interleave
    
    * fix load timeout
    
    * refactor datasets: optimize the cache mechanism and clean up code
    
    * distinguish dataset components based on algorithms
    
    * support fsdp2+3d parallel
    
    * fix lints
    
    * support contiguous batching
    
    * refactor parallel
    
    * zero wasting ppo
    
    * support asend npu
    
    * fix openai convert
    
    * fix npu bugs
    
    * fix npu bug
    
    * dispatch npu flash attn
    
    * adapt asend npu
    
    * fix ppo losses
    
    * steady increase in reward
    
    * faster ppo
    
    * fix top-p generate
    
    * support internlm3
    
    * baseline 2.5
    
    * fix internlm3
    
    * (ing)support hard pack
    
    * support qwen2
    
    * fix dataset bugs
    
    * baseline
    
    * del ppo.py
    
    * fixup
    
    * support hybrid sp
    
    * fix hybrid sp
    
    * qwen2 + hybird sp
    
    * fix requirements
    
    * avoid re-initialize dist
    
    * support group pack
    
    * pretrain (#13)
    
    * first commit: support internlm3 moe streaming dataset
    
    * move codes
    
    * Moe pretrain (#14)
    
    * first commit: support internlm3 moe streaming dataset
    
    * move codes
    
    * rmsnorm kernel support low version flash_attn
    
    * add barrier
    
    * support prompt length control (#15)
    
    * support VLM Base (#16)
    
    * add internvl
    
    * fix bug
    
    * remove dup code
    
    * support liger of internvl
    
    * fix bug
    
    * add get_repo_git_info
    
    * fix
    
    * add minicpmv
    
    * add minicpmv dispatch
    
    * accelerate tokenize
    
    * Updata InternVL (#17)
    
    * fix dpo error
    
    * fix sp error
    
    * update dataset
    
    * fix
    
    * fix rand sampler (#18)
    
    * llama support transformers >= 4.45 (#19)
    
    * convert fsdp1 to fsdp2 in sft.py
    
    * [Feature] Support Liger Kernel (#20)
    
    * filter data by max length (#21)
    
    * fix causal forward, prefetch, and remote code (#22)
    
    * [Enhancement] Accelerating Data Pipeline (#23)
    
    * sample ratio greater than 1.0 and trunc max len
    
    * accelerating the counting of tokens
    
    * log reduced loss
    
    * fix mirco bs greater than 1
    
    * [Enhancement] Ensure data integrity when the sampling ratio is more than 1 (#24)
    
    * repeat dataset
    
    * fixup
    
    * fix typos
    
    * fix typos
    
    * [Fix] Pass in temperature during generation (#25)
    
    * Support Janus and fix some error (#27)
    
    * add prefetch
    
    * update prefetch
    
    * add janus
    
    * add janus
    
    * fix
    
    * fix
    
    * fix llama position id error
    
    * fix ProcessPoolExecutor
    
    * update
    
    * fix llama
    
    * delete cache
    
    * remove useless code
    
    ---------
    
    Co-authored-by: whcao <[email protected]>
    Co-authored-by: Happy <[email protected]>
    Co-authored-by: Haian Huang(深度眸) <[email protected]>
    
    * support mlu (#984)
    
    * cleanup
    
    * add internlm3 remote code
    
    * cleanup
    
    * auto patch
    
    * remove useless code
    
    ---------
    
    Co-authored-by: whcao <[email protected]>
    Co-authored-by: Happy <[email protected]>
    Co-authored-by: Haian Huang(深度眸) <[email protected]>
    Co-authored-by: Lantian Zhang <[email protected]>
    5 people authored Jan 21, 2025
    Copy the full SHA
    4a521fb View commit details

Commits on Jan 22, 2025

  1. [Fix]MLU Device Mesh (#987)

    * fix mlu device mesh
    
    * update requirements
    pppppM authored Jan 22, 2025
    Copy the full SHA
    4cade9f View commit details

Commits on Feb 21, 2025

  1. bump version to v0.2.0rc0 (#990)

    * refactor dispatch
    
    * support qwen2
    
    * sp gather logprobs
    
    * optimize gpu memory
    
    * fix tp sample
    
    * fix auto cls
    
    * fix saved dtype
    
    * remove ascend llama
    
    * accelerate sp all to all
    
    * optimize long prefilling
    
    * fix tp>2 generate
    
    * [Enhance] Using `fork` mode for tokenization (#28)
    
    * integrate training and inference
    
    * [Enhance] Enhance the calculation of tokenize fn hash (#29)
    
    * [Fix] Cannot properly load buffer from the checkpoint (#30)
    
    * fix load buffer bug
    
    * add moe permute
    
    * fix lints
    
    * rm internvl2 dataset
    
    * rm tools
    
    * update precommit
    
    * bump version
    
    ---------
    
    Co-authored-by: Mashiro <[email protected]>
    Co-authored-by: whcao <[email protected]>
    3 people authored Feb 21, 2025
    Copy the full SHA
    bbcd94b View commit details
  2. Update README.md

    pppppM authored Feb 21, 2025
    Copy the full SHA
    53f2429 View commit details
Showing 833 changed files with 51,070 additions and 27,077 deletions.
51 changes: 0 additions & 51 deletions .pre-commit-config-zh-cn.yaml

This file was deleted.

29 changes: 16 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
exclude: ^tests/data/|^xtuner/tools/model_converters/modeling_internlm2_reward/
exclude: ^tests/data/|^xtuner/model/transformers_models/|^xtuner/tools/model_converters/modeling_internlm2_reward/|^xtuner/_lite/modelings/|^xtuner/_lite/accelerate/dispatches/huggingface/
repos:
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
args: ["--exclude=xtuner/model/transformers_models/*"]
args: ["--max-line-length=119"]
- repo: https://github.com/PyCQA/isort
rev: 5.11.5
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.32.0
hooks:
- id: yapf
exclude: 'xtuner/parallel/sequence/__init__.py'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-yaml
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: double-quote-string-fixer
- id: check-merge-conflict
- id: fix-encoding-pragma
args: ["--remove"]
@@ -45,9 +37,20 @@ repos:
rev: v1.3.1
hooks:
- id: docformatter
args: ["--in-place", "--wrap-descriptions", "79"]
args: ["--in-place", "--wrap-descriptions", "119"]
- repo: https://github.com/open-mmlab/pre-commit-hooks
rev: v0.4.0
hooks:
- id: check-copyright
args: ["xtuner", "--excludes", "xtuner/_lite/modelings/", "xtuner/model/transformers_models/"]
- id: remove-improper-eol-in-cn-docs
- repo: https://github.com/asottile/pyupgrade
rev: v3.0.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]

- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -38,7 +38,9 @@ English | [简体中文](README_zh-CN.md)
</div>

## 🎉 News

- **\[2025/02\]** Support [OREAL](https://github.com/InternLM/OREAL), a new RL method for math reasoning!
- **\[2025/01\]** Support [InternLM3 8B Instruct](https://huggingface.co/internlm/internlm3-8b-instruct)!
- **\[2024/07\]** Support [MiniCPM](xtuner/configs/minicpm/) models!
- **\[2024/07\]** Support [DPO](https://github.com/InternLM/xtuner/tree/main/xtuner/configs/dpo), [ORPO](https://github.com/InternLM/xtuner/tree/main/xtuner/configs/orpo) and [Reward Model](https://github.com/InternLM/xtuner/tree/main/xtuner/configs/reward_model) training with packed data and sequence parallel! See [documents](https://xtuner.readthedocs.io/en/latest/dpo/overview.html) for more details.
- **\[2024/07\]** Support [InternLM 2.5](xtuner/configs/internlm/internlm2_5_chat_7b/) models!
- **\[2024/06\]** Support [DeepSeek V2](xtuner/configs/deepseek/deepseek_v2_chat/) models! **2x faster!**
@@ -113,6 +115,7 @@ XTuner is an efficient, flexible and full-featured toolkit for fine-tuning large
<li><a href="https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1">Mixtral</a></li>
<li><a href="https://huggingface.co/deepseek-ai/DeepSeek-V2-Chat">DeepSeek V2</a></li>
<li><a href="https://huggingface.co/google">Gemma</a></li>
<li><a href="https://huggingface.co/openbmb">MiniCPM</a></li>
<li>...</li>
</ul>
</td>
2 changes: 2 additions & 0 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@

## 🎉 更新

- **\[2024/07\]** 支持 [MiniCPM](xtuner/configs/minicpm/) 模型!
- **\[2024/07\]** 支持训练 [DPO](https://github.com/InternLM/xtuner/tree/main/xtuner/configs/dpo)[ORPO](https://github.com/InternLM/xtuner/tree/main/xtuner/configs/orpo) 还有 [Reward Model](https://github.com/InternLM/xtuner/tree/main/xtuner/configs/reward_model) ! 并且能够支持打包数据以及序列并行功能! 请参考 [文档](https://xtuner.readthedocs.io/zh-cn/latest/dpo/overview.html) 了解更多信息。
- **\[2024/07\]** 支持 [InternLM 2.5](xtuner/configs/internlm/internlm2_5_chat_7b/) 模型!
- **\[2024/06\]** 支持 [DeepSeek V2](xtuner/configs/deepseek/deepseek_v2_chat/) models! **训练速度提升一倍!**
@@ -113,6 +114,7 @@ XTuner 是一个高效、灵活、全能的轻量化大模型微调工具库。
<li><a href="https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1">Mixtral</a></li>
<li><a href="https://huggingface.co/deepseek-ai/DeepSeek-V2-Chat">DeepSeek V2</a></li>
<li><a href="https://huggingface.co/google">Gemma</a></li>
<li><a href="https://huggingface.co/openbmb">MiniCPM</a></li>
<li>...</li>
</ul>
</td>
70 changes: 35 additions & 35 deletions docs/en/conf.py
Original file line number Diff line number Diff line change
@@ -15,19 +15,19 @@

from sphinx.ext import autodoc

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

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

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

# The full version, including alpha/beta/rc tags
version_file = '../../xtuner/version.py'
version_file = "../../xtuner/version.py"
with open(version_file) as f:
exec(compile(f.read(), version_file, 'exec'))
__version__ = locals()['__version__']
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
@@ -39,41 +39,41 @@
# 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',
"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']
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_patterns = ["_build", "Thumbs.db", ".DS_Store"]

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

language = 'en'
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 = "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,
"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,
@@ -82,24 +82,24 @@

# Mock out external dependencies here.
autodoc_mock_imports = [
'cpuinfo',
'torch',
'transformers',
'psutil',
'prometheus_client',
'sentencepiece',
'vllm.cuda_utils',
'vllm._C',
'numpy',
'tqdm',
"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`':
if line == " Bases: :py:class:`object`":
return
super().add_line(line, source, *lineno)

70 changes: 35 additions & 35 deletions docs/zh_cn/conf.py
Original file line number Diff line number Diff line change
@@ -15,19 +15,19 @@

from sphinx.ext import autodoc

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

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

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

# The full version, including alpha/beta/rc tags
version_file = '../../xtuner/version.py'
version_file = "../../xtuner/version.py"
with open(version_file) as f:
exec(compile(f.read(), version_file, 'exec'))
__version__ = locals()['__version__']
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
@@ -39,41 +39,41 @@
# 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',
"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']
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_patterns = ["_build", "Thumbs.db", ".DS_Store"]

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

language = 'zh_CN'
language = "zh_CN"

# -- 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 = "sphinx_book_theme"
html_logo = "_static/image/logo.png"
html_theme_options = {
'path_to_docs': 'docs/zh_cn',
'repository_url': 'https://github.com/InternLM/xtuner',
'use_repository_button': True,
"path_to_docs": "docs/zh_cn",
"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,
@@ -82,24 +82,24 @@

# Mock out external dependencies here.
autodoc_mock_imports = [
'cpuinfo',
'torch',
'transformers',
'psutil',
'prometheus_client',
'sentencepiece',
'vllm.cuda_utils',
'vllm._C',
'numpy',
'tqdm',
"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`':
if line == " Bases: :py:class:`object`":
return
super().add_line(line, source, *lineno)

Loading