Comments (10)
修改 device_map 参数来指定设备。如果你想使用 GPU,将 device_map="auto" 修改为 device_map="cuda"。如果你想使用 CPU,将其修改为 device_map="cpu"
In my case, device_map needs to be set to cuda:0 instead of cuda
from chatglm3-finetune.
Same here, PyTorch reserved too much memory...
from chatglm3-finetune.
Try to modify finetune line 38 to set load_in_8bit to true:
model = AutoModel.from_pretrained(
"{your model path}", load_in_8bit=True, trust_remote_code=True, device_map="auto"
).cuda()
from chatglm3-finetune.
finetune.py line 34 to set load_in_8bit to true and delete half():
Original:
model = ChatGLMForConditionalGeneration.from_pretrained(
"model", load_in_8bit=False, trust_remote_code=False, device_map="auto"
).half()
Modified:
model = ChatGLMForConditionalGeneration.from_pretrained(
"model", load_in_8bit=True, trust_remote_code=False, device_map="auto"
)
Error Message:
File "/root/miniconda3/envs/chatglm3-finetune/lib/python3.10/site-packages/torch/nn/functional.py", line 2210, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:1 and cuda:0! (when checking argument for argument index in method wrapper__index_select)
from chatglm3-finetune.
修改 device_map 参数来指定设备。如果你想使用 GPU,将 device_map="auto" 修改为 device_map="cuda"。如果你想使用 CPU,将其修改为 device_map="cpu"
from chatglm3-finetune.
刚刚测试了,需要 26GB GPU 显存。
Mon Oct 30 11:36:26 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.105.01 Driver Version: 515.105.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:A1:00.0 Off | 0 |
| N/A 51C P0 327W / 400W | 26305MiB / 81920MiB | 95% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 713 C python 26303MiB |
+-----------------------------------------------------------------------------+
from chatglm3-finetune.
刚刚测试了,需要 26GB GPU 显存。 Mon Oct 30 11:36:26 2023 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 515.105.01 Driver Version: 515.105.01 CUDA Version: 11.7 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA A100-SXM... On | 00000000:A1:00.0 Off | 0 | | N/A 51C P0 327W / 400W | 26305MiB / 81920MiB | 95% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | 0 N/A N/A 713 C python 26303MiB | +-----------------------------------------------------------------------------+
那看来不是3090这种24G能玩起来的,毕竟好像也不能多卡FineTune
from chatglm3-finetune.
24G够了,我是4090单卡,一个epoch10秒,还挺快
from chatglm3-finetune.
刚刚测试了,需要 26GB GPU 显存。 Mon Oct 30 11:36:26 2023 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 515.105.01 Driver Version: 515.105.01 CUDA Version: 11.7 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA A100-SXM... On | 00000000:A1:00.0 Off | 0 | | N/A 51C P0 327W / 400W | 26305MiB / 81920MiB | 95% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | 0 N/A N/A 713 C python 26303MiB | +-----------------------------------------------------------------------------+那看来不是3090这种24G能玩起来的,毕竟好像也不能多卡FineTune
今天用3090也试了一下,没问题的
from chatglm3-finetune.
刚刚测试了,需要 26GB GPU 显存。 Mon Oct 30 11:36:26 2023 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 515.105.01 Driver Version: 515.105.01 CUDA Version: 11.7 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA A100-SXM... On | 00000000:A1:00.0 Off | 0 | | N/A 51C P0 327W / 400W | 26305MiB / 81920MiB | 95% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | 0 N/A N/A 713 C python 26303MiB | +-----------------------------------------------------------------------------+那看来不是3090这种24G能玩起来的,毕竟好像也不能多卡FineTune
今天用3090也试了一下,没问题的
from chatglm3-finetune.
Related Issues (19)
- Something wrong in the data preprocess HOT 3
- from model.modeling_chatglm import ChatGLMForConditionalGeneration not found HOT 1
- No module named 'model' HOT 1
- 大佬能否出一个多卡训练的脚本?
- 大佬可否提供一个int4量化微调的代码参考一下 HOT 1
- 请问下 如何用这种openai api的方式推理微调过的 模型。 HOT 1
- 微调后的推理结果残缺不全 HOT 2
- 如何增加工具,使得模型能够识别? HOT 1
- 应该如何测试微调出来的效果? HOT 1
- UnicodeDecodeError: 'gbk' codec can't decode byte 0xa4 in position 64: illegal multibyte sequence HOT 2
- SFTTrainner封装训练时间倍增 HOT 2
- lora存checkpoint的问题 HOT 2
- 你好,我用您的代码跑不管是multi还是默认的都无法自动部署在多卡上,请问需要调整代码解决吗,GPU是Tesla T4*4 HOT 3
- evaluate时显存暴增 HOT 2
- It is recommended to support multiple GPU cards HOT 2
- huggingface_hub.utils._validators.HFValidationError: Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: './bge-large-zh'. HOT 1
- RuntimeError: probability tensor contains either `inf`, `nan` or element < 0 HOT 2
- FileNotFoundError: [Errno 2] No such file or directory: 'data/npc_data.csv'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatglm3-finetune.