-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeError: expected mat1 and mat2 to have the same dtype, but got: c10::Half != float #693
Comments
两个tensor数据类型不一样,能提供示例吗 |
from transformers import ( device_map = {'transformer.word_embeddings': 0,'transformer.final_layernorm': num_gpus-1, 'lm_head': num_gpus-1}model = AutoModelForCausalLM.from_pretrained("/starfs-dev1/miaochaowei/deepctrcloudml/DeepCTR2/llmdemo/glm-4-9b-chat/", trust_remote_code=True).half().cuda() model = model.eval()tokenizer = AutoTokenizer.from_pretrained("/starfs-dev1/miaochaowei/deepctrcloudml/DeepCTR2/llmdemo/glm-4-9b-chat/", trust_remote_code=True) #--------------------------------------------lora train----------- model = get_peft_model(model, config) def process_func(example): args = TrainingArguments( trainer = Trainer(
上面是所有的代码 |
是否有使用int4之类的工作,或者GPU不支持BF16 |
System Info / 系統信息
transformers 4.47.1
python 3.11
Who can help? / 谁可以帮助到您?
No response
Information / 问题信息
Reproduction / 复现过程
args=TrainingArguments(
per_device_train_batch_size=2,
optim="adafactor", gradient_checkpointing=False,
gradient_accumulation_steps=4,
warmup_steps=2,
max_steps=10,
learning_rate=2e-4,
seed = 42,
report_to="wandb",
fp16=False,
logging_steps=1,
output_dir="./GLM4"
)
trainer = Trainer(
model=model,
args=args,
train_dataset=tokenized_id,
data_collator=DataCollatorForSeq2Seq(tokenizer=tokenizer, padding=True),
)
trainer.train()---这一步执行报错,
Expected behavior / 期待表现
希望可以解决该问题
The text was updated successfully, but these errors were encountered: