Skip to content
Merged

Best #163

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
424629f
[shardformer/sequence parallel] Cherry pick commit to new branch (#4450)
FoolPlayer Aug 16, 2023
6ef33f7
[shardformer] support DDP in HybridPlugin/add tp+dp tests (#4446)
Aug 16, 2023
26e29d5
[devops] add large-scale distributed test marker (#4452)
ver217 Aug 16, 2023
a78daf6
[shardformer] support interleaved pipeline (#4448)
Gy-Lu Aug 16, 2023
7c8be77
[shardformer/sequence parallel] support gpt2 seq parallel with pp/dp/…
FoolPlayer Aug 18, 2023
0ecd71e
[shardformer] bloom support sequence parallel (#4465)
flybird11111 Aug 18, 2023
a27e0bb
[shardformer] bert support sequence parallel. (#4455)
flybird11111 Aug 18, 2023
8739aa7
[shardformer] Pipeline/whisper (#4456)
CjhHa1 Aug 18, 2023
1c7df56
[shardformer] support tp+zero for shardformer (#4472)
Aug 21, 2023
5545114
rename chatglm to chatglm2 (#4484)
CjhHa1 Aug 22, 2023
351351a
[shardformer/sequence parallel] not support opt of seq-parallel, add …
FoolPlayer Aug 22, 2023
59e252e
[shardformer] chatglm support sequence parallel (#4482)
flybird11111 Aug 22, 2023
e04436a
[shardformer] tests for 3d parallel (#4493)
CjhHa1 Aug 23, 2023
3353e55
[shardformer] vit/llama/t5 ignore the sequence parallelism flag and s…
flybird11111 Aug 24, 2023
17e5edb
Merge pull request #144 from jamesthesnake/better
jamesthesnake Aug 24, 2023
b8d6a96
Merge pull request #145 from jamesthesnake/best
jamesthesnake Aug 24, 2023
3635068
Merge pull request #146 from jamesthesnake/ra
jamesthesnake Aug 24, 2023
8d77dcf
Merge pull request #148 from jamesthesnake/best
jamesthesnake Aug 24, 2023
de8a65b
[shardformer] opt fix. (#4514)
flybird11111 Aug 25, 2023
44eab2b
[shardformer] support sharded checkpoint IO for models of HybridParal…
Aug 25, 2023
376533a
[shardformer] zero1+pp and the corresponding tests (#4517)
CjhHa1 Aug 28, 2023
c554b7f
[shardformer/fix overlap bug] fix overlap bug, add overlap as an opti…
FoolPlayer Aug 28, 2023
0387a47
[shardformer] fix emerged bugs after updating transformers (#4526)
Aug 29, 2023
1467e3b
[coati] add chatglm model (#4539)
yingliu-hpc Aug 29, 2023
e241b74
[shardformer] Add overlap support for gpt2 (#4535)
FoolPlayer Aug 29, 2023
1c43bfd
[coati] update ci
ver217 Aug 30, 2023
661a1ef
Merge pull request #4541 from ver217/coati/chatglm
yingliu-hpc Aug 30, 2023
c648dc0
fix colossalai version in coati examples
yingliu-hpc Aug 30, 2023
d367b88
[shardformer] fix opt test hanging (#4521)
flybird11111 Aug 30, 2023
9f852f2
keep requirements same with main branch
yingliu-hpc Aug 30, 2023
ec18fc7
[shardformer] support pp+tp+zero1 tests (#4531)
flybird11111 Aug 30, 2023
2c787d7
[shardformer] fix submodule replacement bug when enabling pp (#4544)
Aug 31, 2023
c9625db
[shardformer] support sharded optimizer checkpointIO of HybridParalle…
Aug 31, 2023
38ccb8b
[shardformer] support from_pretrained when loading model with HybridP…
Sep 1, 2023
508ca36
[pipeline] 1f1b schedule receive microbatch size (#4589)
ver217 Sep 1, 2023
5a571c3
Merge pull request #151 from jamesthesnake/better
jamesthesnake Sep 3, 2023
131e54e
Merge pull request #152 from jamesthesnake/ra
jamesthesnake Sep 3, 2023
1197766
Merge pull request #153 from jamesthesnake/best
jamesthesnake Sep 3, 2023
f87802e
Merge pull request #154 from jamesthesnake/co
jamesthesnake Sep 3, 2023
63ecafb
[checkpointio] optimize zero optim checkpoint io (#4591)
ver217 Sep 4, 2023
7a978eb
[DOC] hotfix/llama2news (#4595)
binmakeswell Sep 4, 2023
8d7b022
[doc] add llama2 benchmark (#4604)
binmakeswell Sep 4, 2023
aaeb520
Merge pull request #4542 from hpcaitech/chatglm
yingliu-hpc Sep 4, 2023
24c0768
[shardformer] Pytree fix (#4533)
CjhHa1 Sep 4, 2023
0a94fcd
[shardformer] update bert finetune example with HybridParallelPlugin …
flybird11111 Sep 4, 2023
e79b1e8
[checkpointio] support huggingface from_pretrained for all plugins (#…
Sep 4, 2023
a39a5c6
Merge branch 'main' into feature/shardformer
ver217 Sep 4, 2023
30b1e1f
Merge pull request #155 from hpcaitech/main
jamesthesnake Sep 5, 2023
b259cf6
Merge pull request #156 from jamesthesnake/main
jamesthesnake Sep 5, 2023
2f3819f
Merge pull request #157 from jamesthesnake/jordan
jamesthesnake Sep 5, 2023
06f7c14
Merge pull request #158 from jamesthesnake/l
jamesthesnake Sep 5, 2023
86d2258
[shardformer] Add overlap optional for HybridParallelPlugin (#4615)
FoolPlayer Sep 5, 2023
ec08668
[shardformer] update shardformer readme (#4617)
flybird11111 Sep 5, 2023
e71d245
[test] ignore gpt2 shardformer test (#4619)
ver217 Sep 5, 2023
807e01a
[zero] hotfix master param sync (#4618)
ver217 Sep 5, 2023
bd18678
[test] fix gemini checkpoint and gpt test (#4620)
ver217 Sep 5, 2023
89fe027
[legacy] move trainer to legacy (#4545)
ver217 Aug 31, 2023
8accecd
[legacy] move engine to legacy (#4560)
ver217 Sep 4, 2023
ac178ca
[legacy] move builder and registry to legacy (#4603)
ver217 Sep 4, 2023
fae6c92
Merge branch 'main' into feature/shardformer
ver217 Sep 5, 2023
efba0f4
Merge pull request #4612 from hpcaitech/feature/shardformer
ver217 Sep 5, 2023
9709b8f
[release] update version (#4623)
ver217 Sep 6, 2023
c3d5fa3
[shardformer] Support customized policy for llamav2 based model with …
eric8607242 Sep 7, 2023
660eed9
[pipeline] set optimizer to optional in execute_pipeline (#4630)
Sep 7, 2023
295b38f
[example] update vit example for hybrid parallel plugin (#4641)
Sep 7, 2023
a686f9d
[devops] fix concurrency group and compatibility test (#4665)
ver217 Sep 8, 2023
973f7e4
Merge pull request #161 from hpcaitech/main
jamesthesnake Sep 8, 2023
622c3bc
Merge pull request #162 from jamesthesnake/l
jamesthesnake Sep 8, 2023
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
8 changes: 4 additions & 4 deletions .github/workflows/build_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-repare-cache
cancel-in-progress: true
steps:
- name: Copy testmon cache
Expand All @@ -87,7 +87,7 @@ jobs:
anyLibraryFileChanged: ${{ steps.find-lib-change.outputs.any_changed }}
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-detect-change
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-run-test
cancel-in-progress: true
steps:
- name: Checkout TensorNVMe
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:

- name: Execute Unit Testing
run: |
CURL_CA_BUNDLE="" PYTHONPATH=$PWD pytest --testmon --testmon-cov=. --durations=10 tests/
CURL_CA_BUNDLE="" PYTHONPATH=$PWD pytest -m "not largedist" --testmon --testmon-forceselect --testmon-cov=. --durations=10 tests/
env:
DATA: /data/scratch/cifar-10
NCCL_SHM_DISABLE: 1
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/compatiblity_test_on_dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
name: Test for PyTorch Compatibility
needs: matrix_preparation
if: github.repository == 'hpcaitech/ColossalAI'
runs-on: [self-hosted, gpu]
runs-on: [self-hosted, 8-gpu]
strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix_preparation.outputs.matrix)}}
Expand All @@ -64,7 +64,7 @@ jobs:
- name: Install tensornvme
run: |
cd TensorNVMe
conda install cmake
apt update && apt install -y cmake
pip install -r requirements.txt
pip install -v .
- uses: actions/checkout@v2
Expand All @@ -83,8 +83,7 @@ jobs:
fi
- name: Install Colossal-AI
run: |
pip install -r requirements/requirements.txt
pip install -v --no-cache-dir .
CUDA_EXT=1 pip install -v .
pip install -r requirements/requirements-test.txt
- name: Unit Testing
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/compatiblity_test_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-prepare-matrix
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
Expand All @@ -35,7 +35,7 @@ jobs:
name: Test for PyTorch Compatibility
needs: matrix_preparation
if: github.repository == 'hpcaitech/ColossalAI'
runs-on: [self-hosted, gpu]
runs-on: [self-hosted, 8-gpu]
strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix_preparation.outputs.matrix)}}
Expand All @@ -44,7 +44,7 @@ jobs:
options: --gpus all --rm -v /data/scratch/cifar-10:/data/scratch/cifar-10
timeout-minutes: 120
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-run-test
cancel-in-progress: true
steps:
- name: Install dependencies
Expand All @@ -58,7 +58,7 @@ jobs:
- name: Install tensornvme
run: |
cd TensorNVMe
conda install cmake
apt update && apt install -y cmake
pip install -r requirements.txt
pip install -v .
- uses: actions/checkout@v2
Expand All @@ -78,7 +78,7 @@ jobs:

- name: Install Colossal-AI
run: |
pip install -v --no-cache-dir .
CUDA_EXT=1 pip install -v .
pip install -r requirements/requirements-test.txt
- name: Unit Testing
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/compatiblity_test_on_schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
name: Test for PyTorch Compatibility
needs: matrix_preparation
if: github.repository == 'hpcaitech/ColossalAI'
runs-on: [self-hosted, gpu]
runs-on: [self-hosted, 8-gpu]
strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix_preparation.outputs.matrix)}}
Expand All @@ -54,7 +54,7 @@ jobs:
- name: Install tensornvme
run: |
cd TensorNVMe
conda install cmake
apt update && apt install -y cmake
pip install -r requirements.txt
pip install -v .
- uses: actions/checkout@v2
Expand All @@ -75,7 +75,7 @@ jobs:

- name: Install Colossal-AI
run: |
pip install -v --no-cache-dir .
CUDA_EXT=1 pip install -v .
pip install -r requirements/requirements-test.txt

- name: Unit Testing
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/doc_check_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-check-i18n
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
Expand All @@ -35,7 +35,7 @@ jobs:
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-check-doc
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/doc_test_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
any_changed: ${{ steps.changed-files.outputs.any_changed }}
changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-detect-change
cancel-in-progress: true
name: Detect changed example files
steps:
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-run-doctest
cancel-in-progress: true
steps:
- name: Checkout ColossalAI-Documentation
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/example_check_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
anyChanged: ${{ steps.setup-matrix.outputs.anyChanged }}
name: Detect changed example files
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-detect-change
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
options: --gpus all --rm -v /data/scratch/examples-data:/data/
timeout-minutes: 10
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-run-example
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/run_chatgpt_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ jobs:
- name: Checkout ColossalAI
uses: actions/checkout@v2

- name: Install ColossalAI and ChatGPT
- name: Install ChatGPT
run: |
pip install -e .
cd applications/Chat
pip install -v .
pip install -r examples/requirements.txt
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/run_chatgpt_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ jobs:
- name: Checkout ColossalAI
uses: actions/checkout@v2

- name: Install ColossalAI and ChatGPT
- name: Install ChatGPT
run: |
pip install -e .
cd applications/Chat
pip install -v .
pip install -r requirements-test.txt
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
</div>

## Latest News
* [2023/09] [70 Billion Parameter LLaMA2 Model Training Accelerated by 195%](https://www.hpc-ai.tech/blog/70b-llama2-training)
* [2023/07] [HPC-AI Tech Raises 22 Million USD in Series A Funding](https://www.hpc-ai.tech/blog/hpc-ai-tech-raises-22-million-usd-in-series-a-funding-to-fuel-team-expansion-and-business-growth)
* [2023/07] [65B Model Pretraining Accelerated by 38%, Best Practices for Building LLaMA-Like Base Models Open-Source](https://www.hpc-ai.tech/blog/large-model-pretraining)
* [2023/03] [ColossalChat: An Open-Source Solution for Cloning ChatGPT With a Complete RLHF Pipeline](https://medium.com/@yangyou_berkeley/colossalchat-an-open-source-solution-for-cloning-chatgpt-with-a-complete-rlhf-pipeline-5edf08fb538b)
Expand All @@ -50,7 +51,7 @@
<li>
<a href="#Parallel-Training-Demo">Parallel Training Demo</a>
<ul>
<li><a href="#LLaMA">LLaMA</a></li>
<li><a href="#LLaMA2">LLaMA 1/2</a></li>
<li><a href="#GPT-3">GPT-3</a></li>
<li><a href="#GPT-2">GPT-2</a></li>
<li><a href="#BERT">BERT</a></li>
Expand Down Expand Up @@ -217,8 +218,16 @@ Acceleration of [AlphaFold Protein Structure](https://alphafold.ebi.ac.uk/)
<p align="right">(<a href="#top">back to top</a>)</p>

## Parallel Training Demo
### LLaMA2
<p align="center">
<img src="https://github.com/hpcaitech/public_assets/main/colossalai/img/llama2_pretraining.png" width=600/>
</p>

- 70 billion parameter LLaMA2 model training accelerated by 195%
[[code]](https://github.com/hpcaitech/ColossalAI/tree/example/llama/examples/language/llama)
[[blog]](https://www.hpc-ai.tech/blog/70b-llama2-training)

### LLaMA
### LLaMA1
<p align="center">
<img src="https://github.com/hpcaitech/public_assets/main/examples/images/LLaMA_pretraining.png" width=600/>
</p>
Expand Down
75 changes: 63 additions & 12 deletions applications/Chat/coati/dataset/sft_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from torch.utils.data import Dataset
from tqdm import tqdm
from transformers import PreTrainedTokenizer

from coati.models.chatglm.chatglm_tokenizer import ChatGLMTokenizer
from colossalai.logging import get_dist_logger

from .utils import is_rank_0, jload
Expand Down Expand Up @@ -71,6 +71,42 @@ def _preprocess(sources: Sequence[str],
return sequences_token["input_ids"], labels, sequences_token["attention_mask"]


def _preprocess_chatglm(sources: Sequence[str],
targets: Sequence[str],
tokenizer: PreTrainedTokenizer,
max_length: int,
) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
"""
Preprocess the data by tokenizing.
None for attention mask, ChatGLM will calculate attention mask according to input ids
"""

labels = []
input_ids = []
for source, target in zip(sources, targets):
source_id = tokenizer.encode(text=source, add_special_tokens=False)
target_id = tokenizer.encode(text=target, add_special_tokens=False)
input_id = tokenizer.build_inputs_with_special_tokens(source_id, target_id)
# truncate
sp_token_list = [tokenizer.gmask_token_id, tokenizer.bos_token_id]
truncate_length = max(0, len(input_id) - max_length)
input_id = input_id[truncate_length: ]
if truncate_length == len(source_id) + 1:
input_id = sp_token_list + input_id[1: ]
elif truncate_length > len(source_id) + 1:
input_id = sp_token_list + input_id[2: ]

context_length = input_id.index(tokenizer.bos_token_id)
mask_position = context_length - 1
label = [IGNORE_INDEX] * context_length + input_id[mask_position+1:]

pad_len = max_length - len(input_id)
input_id = input_id + [tokenizer.pad_token_id] * pad_len
input_ids.append(input_id)
labels.append(label + [IGNORE_INDEX] * pad_len)
return torch.tensor(input_ids), torch.tensor(labels), None


class SFTDataset(Dataset):
"""
Dataset for sft model
Expand All @@ -94,18 +130,25 @@ def __init__(self,
data["completion"] + tokenizer.eos_token
for data in tqdm(dataset, disable=not is_rank_0())
]

self.input_ids, self.labels, self.attention_mask = \
_preprocess(sources, targets, tokenizer, max_length)
if isinstance(tokenizer, ChatGLMTokenizer):
self.input_ids, self.labels, self.attention_mask = \
_preprocess_chatglm(sources, targets, tokenizer, max_length)
else:
self.input_ids, self.labels, self.attention_mask = \
_preprocess(sources, targets, tokenizer, max_length)

def __len__(self):
length = self.input_ids.shape[0]
return length

def __getitem__(self, idx):
return dict(input_ids=self.input_ids[idx],
labels=self.labels[idx],
attention_mask=self.attention_mask[idx])
if self.attention_mask is not None:
return dict(input_ids=self.input_ids[idx],
labels=self.labels[idx],
attention_mask=self.attention_mask[idx])
else:
return dict(input_ids=self.input_ids[idx],
labels=self.labels[idx])


class SupervisedDataset(Dataset):
Expand Down Expand Up @@ -137,14 +180,22 @@ def __init__(self,
]

logger.info("Tokenizing inputs... This may take some time...")
self.input_ids, self.labels, self.attention_mask = \
_preprocess(sources, targets, tokenizer, max_length)
if isinstance(tokenizer, ChatGLMTokenizer):
self.input_ids, self.labels, self.attention_mask = \
_preprocess_chatglm(sources, targets, tokenizer, max_length)
else:
self.input_ids, self.labels, self.attention_mask = \
_preprocess(sources, targets, tokenizer, max_length)

def __len__(self):
length = self.input_ids.shape[0]
return length

def __getitem__(self, idx):
return dict(input_ids=self.input_ids[idx],
labels=self.labels[idx],
attention_mask=self.attention_mask[idx])
if self.attention_mask is not None:
return dict(input_ids=self.input_ids[idx],
labels=self.labels[idx],
attention_mask=self.attention_mask[idx])
else:
return dict(input_ids=self.input_ids[idx],
labels=self.labels[idx])
3 changes: 3 additions & 0 deletions applications/Chat/coati/models/chatglm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .chatglm_actor import ChatGLMActor

__all__ = ['ChatGLMActor']
34 changes: 34 additions & 0 deletions applications/Chat/coati/models/chatglm/chatglm_actor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from typing import Optional

import torch
from .configuration_chatglm import ChatGLMConfig
from .modeling_chatglm import ChatGLMForConditionalGeneration

from ..base import Actor


class ChatGLMActor(Actor):
"""
ChatGLM Actor model.

Args:
pretrained (str): Pretrained model name or path.
config (ChatGLMConfig): Model config.
checkpoint (bool): Enable gradient checkpointing.

do not support lora for now.
"""

def __init__(self,
pretrained: str = None,
config: Optional[ChatGLMConfig] = None,
checkpoint: bool = False) -> None:
if pretrained is not None:
model = ChatGLMForConditionalGeneration.from_pretrained(pretrained)
elif config is not None:
model = ChatGLMForConditionalGeneration(config)
else:
model = ChatGLMForConditionalGeneration(ChatGLMConfig())
if checkpoint:
model.gradient_checkpointing_enable()
super().__init__(model, lora_rank=0, lora_train_bias='none')
Loading