mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2026-08-17 21:45:48 +08:00
[feat] support HyperParallel Context Parallel feature (#10559)
Co-authored-by: wcrzlh <weichaoran@huawei.com>
This commit is contained in:
@@ -500,6 +500,10 @@ class FinetuningArguments(
|
||||
)
|
||||
},
|
||||
)
|
||||
hyper_parallel_cp_size: int = field(
|
||||
default=1,
|
||||
metadata={"help": "Context parallel size used when `use_hyper_parallel=True`."},
|
||||
)
|
||||
use_muon: bool = field(
|
||||
default=False,
|
||||
metadata={"help": "Whether or not to use the Muon optimizer."},
|
||||
@@ -576,6 +580,7 @@ class FinetuningArguments(
|
||||
assert self.finetuning_type in ["lora", "oft", "freeze", "full"], "Invalid fine-tuning method."
|
||||
assert self.ref_model_quantization_bit in [None, 8, 4], "We only accept 4-bit or 8-bit quantization."
|
||||
assert self.reward_model_quantization_bit in [None, 8, 4], "We only accept 4-bit or 8-bit quantization."
|
||||
assert self.hyper_parallel_cp_size > 0, "`hyper_parallel_cp_size` must be greater than 0."
|
||||
|
||||
if self.stage == "ppo" and self.reward_model is None:
|
||||
raise ValueError("`reward_model` is necessary for PPO training.")
|
||||
|
||||
Reference in New Issue
Block a user