Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions mftcoder_accelerate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ Frequently used arguments are provided in ```configs/***_train_config``` and exp

- **role_markers**: {"system": "\<s\>system\n", "user": "\<s\>human\n", "assistant": "\<s\>bot\n} as default(null). You could set your preferred role_markers as the templates startting "system", "user" and "assistant". e.g. {"system": "### System:\n", "user": "### Instruction:\n", "assistant": "### Response:\n"}

#### CoBa Parameter Configuration
- **coba_warmup_steps**: The number of warm-up steps for CoBa. During the warm-up period, all task weights are equal, and after the warm-up, weights begin to be adjusted dynamically. It is generally recommended to set this close to the total number of validation batches.
- **coba_history_length**: The historical window length of validation loss maintained by CoBa, used to fit the convergence slope at the current step. It is generally recommended to set this between 2 times and 5 times the **coba_warmup_steps**. Typically, the larger this value, the smaller the changes in weights will be.
- **coba_tau**: The temperature coefficient for the Divergence Factor (DF). It is generally set to 5.
- **coba_update_interval**: The frequency at which CoBa updates weights. It is commonly set to 1, meaning weights are updated at every step.
- **coba_sample_valid_num**: The number of validation batches to be sampled by CoBa at each step. Theoretically, when this value equals the total number of validation batches, the fitted convergence slope most closely approximates the actual situation. However, considering computational requirements, it is recommended to set it to 1.

## 4. Model Usage

Expand Down
7 changes: 7 additions & 0 deletions mftcoder_accelerate/README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ _**训练需要的参数配置在```configs/*_train_config```中,主要参数
- **saving_limit**:整数,ckpt存储数量上限, 全量训练必须设置。默认null即不限制数量。
- **role_markers**: null,即使用{"system": "\<s\>system\n", "user": "\<s\>human\n", "assistant": "\<s\>bot\n"}。 你可以自定义 "system", "user" and "assistant"的模板, 用于定制自己的问答或者对话模板,比如 {"system": "### System:\n", "user": "### Instruction:\n", "assistant": "### Response:\n"}

#### CoBa相关参数配置
- **coba_warmup_steps**: CoBa的warm-up步数。在warm-up期间,各任务权重相等,warm-up之后,开始动态调整权重。一般建议设置为与valid batch总数量相近即可。
- **coba_history_length**: CoBa维护的valid loss的历史窗口长度,用于拟合当前步收敛斜率。一般建议设置为2倍**coba_warmup_steps**至5倍**coba_warmup_steps**之间。一般该值越大,权重的变化幅度就会越小。
- **coba_tau**: 发散因子(DF)的温度系数。一般设置为5即可。
- **coba_update_interval**: CoBa更新权重的频率。一般设置为1,即每一步都对权重做更新。
- **coba_sample_valid_num**: CoBa每一步要取的valid batch数。理论上当该值等于valid batch总数量时,拟合出的收敛斜率最逼近真实情况,但考虑到计算需求,建议设置为1。

## 4. 模型使用

### 4.1 权重合并
Expand Down
2 changes: 1 addition & 1 deletion mftcoder_accelerate/src/mpt/mpt_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class MptTrainArgs:

# warm-up steps for CoBa, recommand the number of valid batches
coba_warmup_steps: int = 100
# history length of sample valid loss used to fit the slope curve in CoBa
# history length of sample valid loss used to fit the slope curve in CoBa, recommand [2*coba_warmup_steps,5*coba_warmup_steps]
coba_history_length: int = 200
# temperature for divergence factor in CoBa
coba_tau: int = 5
Expand Down
2 changes: 1 addition & 1 deletion mftcoder_accelerate/src/pefts/mft_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class MftTrainArgs:

# warm-up steps for CoBa, recommand the number of valid batches
coba_warmup_steps: int = 100
# history length of sample valid loss used to fit the slope curve in CoBa
# history length of sample valid loss used to fit the slope curve in CoBa, recommand [2*coba_warmup_steps,5*coba_warmup_steps]
coba_history_length: int = 200
# temperature for divergence factor in CoBa
coba_tau: int = 5
Expand Down