Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- trainer
- postech 인공지능대학원
- 에러노트
- 포항공대인공지능대학원
- 파인튜닝
- 포스텍인공지능
- Axotl
- 포항공대인공지능
- 대학원합격
- github
- learning_rate
- timeout
- fine_tuning
- torch.distributed
- RuntimeError
- 대학원준비
- postech
- loss
- 사전학습
- 포스텍 ai
- Torch
- 에러
- 파이썬
- DeepSpeed
- 포스텍 인공지능 대학원
- torch_size
- llm파인튜닝
- postech인공지능
- llm
- 러닝레이트
Archives
- Today
- Total
DopeorNope 개발일지
RuntimeError: expected scalar type Half but found Float 에러 해결방법 본문
Axolotl에서 Pre-train 과정에서 다음과 같은 에러가 발생함
RuntimeError: expected scalar type Half but found Float
FP16으로 내가 불러와서 지금 Half(원래는 32비트 이기때문에, FP16은 Half임)로 불러왔지만,
데이터가 지금 float이기 때문에 문제가 발생함
이럴경우 이와 같이 문제를 해결하면 됨.
train.py에서 아래와 같이 trainer.train 하는 곳에서 'cuda'알아서 오토캐스트 해주면 데이터에 맞게 알아서 해결됨.
if cfg.flash_optimum:
with torch.backends.cuda.sdp_kernel(
enable_flash=True, enable_math=True, enable_mem_efficient=True
):
trainer.train(resume_from_checkpoint=resume_from_checkpoint)
else:
with torch.autocast("cuda"): # 추가함
trainer.train(resume_from_checkpoint=resume_from_checkpoint)
'에러 노트' 카테고리의 다른 글
llama.cpp로 양자화 하기 GGUF (1) | 2024.04.03 |
---|---|
[Deepspeed]assert len(set(t.dtype for t in tensors)) == 1에러 해결 (1) | 2024.01.15 |
Multi-GPU 훈련시 Timeout 문제 해결법 (0) | 2024.01.15 |
[LLM,deepspeed, axotl]LLM 파인튜닝시, loss값이 올라가는 현상 (1) | 2024.01.13 |
Axotl & deepspeed zero3: 모델 레이어 불러올때 torch.Size([0]) 해결법 (1) | 2024.01.13 |