Skip to main content

������������MindSpore Transformers���MindFormers���

LICENSE Downloads PyPI PyPI - Python Version

������������

MindSpore Transformers���������������������������������������������������������������������������������������������������������������������������������Transformer���������������������SOTA���������������������������������������������������������������������������������������������������������������������

MindSpore Transformers������������MindSpore���������������������������������������������������������������

  • ���������������������������������������������������������������������
  • ���������������������������������������������
  • ������������������������������������������������������������������������������������
  • ���������������������������������/������������������������������������������������
  • ������������������������������������������������������������������������������������������������
  • ������Trainer���pipeline���AutoClass���������������������������
  • ������������SOTA������������������������������������
  • ���������������������������������������������������

������������MindSpore Transformers���������������������������issue������������������������������������������

������������

MindFormers���������������������������LoRA������������LoRA������������������������������������������������������������������LoRA���������������

������MindFormers������������������������������

������ ������ ������ ��������� ������ ������ LoRA ������ ������
LLaMA2 7B 4K ✓ ✓ generate ✓ ✓ PPL
13B 4K ✓ ✓ generate ✓ ✓ PPL
70B 4K ✓ ✓ generate ✓ ✓ PPL
LLaMA3 8B 8K - ✓ generate - ✓ -
70B 8K ✓ ✓ generate - ✓ -
LLaMA3.1 8B 8K - ✓ docs - ✓ -
70B 8K - ✓ docs - ✓ -
Baichuan2 7B 4K - ✓ generate ✓ ✓ PPL
13B 4K - ✓ generate ✓ ✓ PPL
GLM2 6B 2K - ✓ generate ✓ ✓ PPL / Rouge
GLM3 6B 2K - ✓ generate - ✓ -
GLM3-32K 6B 32K - ✓ generate - ✓ -
GLM4 9B 8K - ✓ generate - ✓ -
CogVLM2-Video 13B 2K - ✓ docs ✓ - -
CogVLM2-Image 19B 4K - - docs - - -
Qwen 7B 8K - ✓ docs ✓ ✓ C-Eval
14B 8K - ✓ docs ✓ ✓ C-Eval
Qwen1.5 0.5B 8K - - docs - ✓ -
1.8B 8K - - docs - ✓ -
4B 8K - - docs - ✓ -
7B 32K ✓ ✓ docs - ✓ -
14B 32K ✓ ✓ docs - ✓ -
32B 8K - - docs - ✓ -
72B 32K ✓ ✓ docs - ✓ -
Qwen2 0.5B 32K - ✓ docs - ✓ -
1.5B 32K - ✓ docs - ✓ -
7B 32K - ✓ docs - ✓ -
57B-A14B 8K - - docs - ✓ -
57B 32K ✓ ✓ docs - ✓ -
72B 128K - ✓ docs - ✓ -
QwenVL 9.6B 2K - ✓ generate - ✓ -
InternLM 7B 2K - ✓ generate ✓ ✓ PPL
20B 2K - ✓ generate ✓ ✓ PPL
InternLM2 7B 2K - ✓ generate - ✓ -
20B 4K - - generate - ✓ -
Yi 6B 2K - ✓ generate ✓ ✓ -
34B 4K ✓ ✓ generate ✓ ✓ -
Mixtral 8x7B 32K ✓ ✓ docs ✓ ✓ -
DeepSeek Coder 33B 4K - ✓ docs ✓ ✓ -
DeepSeek Coder1.5 7B 4K - ✓ docs - - -
DeepSeekV2 236B 4K ✓ ✓ docs - - -
CodeLlama 34B 4K ✓ ✓ generate ✓ ✓ HumanEval
GPT2 13B 2K ✓ ✓ generate ✓ ✓ PPL
Whisper 1.5B - - ✓ - - - -

������������

������������������

������������������������Atlas 800T A2������������������

���������������������������Python���������3.10���

MindFormers MindPet MindSpore CANN ������������ ������������ ������
1.3.0 1.0.4 2.4.0 - driver - ������������

������MindFormers������������������������������������������������CANN������������������������������������������������������������������������������������������������������������������

���������������

MindFormers���MindSpore������������������������

MindFormers MindSpore ���������
1.3.0 2.3 ���
1.2.0 2.4 ���

������������������

MindFormers������������������������������������������������������������������������������

git clone -b r1.3.0 https://gitee.com/mindspore/mindformers.git
cd mindformers
bash build.sh

������������������

MindFormers������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

MindFormers������������������������������������������������������������������������������scripts/msrun_launcher.sh���������������������������������������������������������msrun������������������������msrun��������� ������������������������������������������

������ ������������������ ������������������ ��������� ������
WORKER_NUM ✓ ✓ 8 ���������������������������������������
LOCAL_WORKER - ✓ 8 ���������������������������������������
MASTER_ADDR - ✓ 127.0.0.1 ���������������������������������ip
MASTER_PORT - ✓ 8118 ���������������������������������������
NODE_RANK - ✓ 0 ���������������������rank id
LOG_DIR - ✓ output/msrun_log ������������������������������������������������
JOIN - ✓ False ���������������������������������������
CLUSTER_TIME_OUT - ✓ 7200 ���������������������������������������������

������������������������device_id���������������������������������ASCEND_RT_VISIBLE_DEVICES���������������������2���3������������export ASCEND_RT_VISIBLE_DEVICES=2,3���

������������

# 1. ���������������������������������������8���������
bash scripts/msrun_launcher.sh "run_mindformer.py \
  --config {CONFIG_PATH} \
  --run_mode {train/finetune/eval/predict}"

# 2. ������������������������������������������������������������
bash scripts/msrun_launcher.sh "run_mindformer.py \
  --config {CONFIG_PATH} \
  --run_mode {train/finetune/eval/predict}" WORKER_NUM

# 3. ���������������������������������
bash scripts/msrun_launcher.sh "run_mindformer.py \
  --config {CONFIG_PATH} \
  --run_mode {train/finetune/eval/predict}" \
  WORKER_NUM MASTER_PORT LOG_DIR JOIN CLUSTER_TIME_OUT
  • ������������

    # ���������������������������������������8���������
    bash scripts/msrun_launcher.sh "run_mindformer.py \
      --config path/to/xxx.yaml \
      --run_mode finetune"
    
    # ������������������������������
    bash scripts/msrun_launcher.sh "run_mindformer.py \
      --config path/to/xxx.yaml \
      --run_mode finetune" 8
    
    # ���������������������������������
    bash scripts/msrun_launcher.sh "run_mindformer.py \
      --config path/to/xxx.yaml \
      --run_mode finetune" \
      8 8118 output/msrun_log False 300
    

������������

���������������������������������������������������������������������������������������������������MASTER_ADDR���������������������ip��������� ���������������������ip������������������������������������������NODE_RANK���������

# ���������������������������������
bash scripts/msrun_launcher.sh "run_mindformer.py \
 --config {CONFIG_PATH} \
 --run_mode {train/finetune/eval/predict}" \
 WORKER_NUM LOCAL_WORKER MASTER_ADDR MASTER_PORT NODE_RANK LOG_DIR JOIN CLUSTER_TIME_OUT
  • ������������

    # ������0���������ip���192.168.1.1���������������������������8������������������4���
    bash scripts/msrun_launcher.sh "run_mindformer.py \
      --config {CONFIG_PATH} \
      --run_mode {train/finetune/eval/predict}" \
      8 4 192.168.1.1 8118 0 output/msrun_log False 300
    
    # ������1���������ip���192.168.1.2���������0���������1���������������������NODE_RANK������
    bash scripts/msrun_launcher.sh "run_mindformer.py \
      --config {CONFIG_PATH} \
      --run_mode {train/finetune/eval/predict}" \
      8 4 192.168.1.1 8118 1 output/msrun_log False 300
    

������������

MindFormers������run_mindformer.py������������������������������������������������������������������������������������������������������������������������������������������������

# ������run_mindformer.py������������������������������������������������
python run_mindformer.py --config {CONFIG_PATH} --run_mode {train/finetune/eval/predict}

������������

������������������������������������MindSpore������������Contributor Wiki���

���������������

Apache 2.0���������

Metadata

Release files for mindformers 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mindformers 1.3.0
File Interpreter ABI Platform
mindformers-1.3.0-py3-none-any.whl Python 3 none any Details

Release files / mindformers-1.3.0-py3-none-any.whl

Download URL mindformers-1.3.0-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6d9cd227bf788cad5649e2a8fa862dfd66ee4ffe3f6f20add0e818c2bc15cd34
BLAKE2b-256 checksum
How to use checksums
ca7a04137dcc0de508800bf70272c04727726fa9d9940effc0d18203745b67de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.1

Release history Release notifications | RSS feed

2.0.0

1 release file

1.9.0

1 release file

1.8.0

1 release file

1.7.0

1 release file

1.6.0

1 release file

1.3.2

1 release file

This release

1.3.0 This release

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.8.0

1 release file

0.3.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page