Skip to content

Lora微调,在训练时底层C++代码出错 #2287

@lyh120

Description

@lyh120

Describe the bug/ 问题描述 (Mandatory / 必填)
A clear and concise description of what the bug is.

  • Hardware Environment(Ascend/GPU/CPU) / 硬件环境:

Please delete the backend not involved / 请删除不涉及的后端:
/device ascend/GPU/CPU/kirin/等其他芯片

  • Software Environment / 软件环境 (Mandatory / 必填):
    -- MindSpore version (e.g., 1.7.0.Bxxx) :
    -- Python version (e.g., Python 3.7.5) :
    -- OS platform and distribution (e.g., Linux Ubuntu 16.04):
    -- GCC/Compiler version (if compiled from source):

  • Excute Mode / 执行模式 (Mandatory / 必填)(PyNative/Graph):

Please delete the mode not involved / 请删除不涉及的模式:
/mode pynative
/mode graph

  • To Reproduce / 重现步骤 (Mandatory / 必填)
    Steps to reproduce the behavior:
    1.下载mindnlp源码
    git clone https://github.com/mindspore-lab/mindnlp/
    cd mindnlp
    bash scripts/build_and_reinstall.sh
    2.对应的Lora微调代码

-------------------------

Step 6: 训练参数

-------------------------

args = TrainingArguments(
output_dir="./output_lora_sarcasm",
per_device_train_batch_size=4,
gradient_accumulation_steps=5,
logging_steps=10,
num_train_epochs=3,
save_steps=100,
learning_rate=1e-4,
save_on_each_node=True,
)

trainer = Trainer(
model=model,
args=args,
train_dataset=tokenized_id,
data_collator=DataCollatorForSeq2Seq(tokenizer=tokenizer, padding=True),
)

trainer.train()
trainer.save_model()

  • Expected behavior / 预期结果 (Mandatory / 必填)
    可以成功训练,但实际似乎库的内部C++代码有错误,参数传递的错误

  • 测试案例通过
    Screenshots/ 日志 / 截图 (Mandatory / 必填)

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions