[GH-ISSUE #1773] 微调模型时,cpu可用内存一直下降直到爆炸 #1115

Closed
opened 2026-10-29 14:48:42 +00:00 by bsakaguchi · 4 comments
Owner

Originally created by @SamsFirth on GitHub (Dec 31, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1773

Originally assigned to: @JimmyPeilinLi on GitHub.

Reminder

  • I have read the above rules and searched the existing issues.

System Info

kt0.4.2版本,py3.11,cpu支持amx

Reproduction

使用默认的训练配置文件进行sft,free -h输出的available内存会不断下降,直到训练异常退出

Others

No response

Originally created by @SamsFirth on GitHub (Dec 31, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1773 Originally assigned to: @JimmyPeilinLi on GitHub. ### Reminder - [x] I have read the above rules and searched the existing issues. ### System Info kt0.4.2版本,py3.11,cpu支持amx ### Reproduction 使用默认的训练配置文件进行sft,free -h输出的available内存会不断下降,直到训练异常退出 ### Others _No response_
Author
Owner

@KMSorSMS commented on GitHub (Jan 8, 2026):

你得内存大小是多少呢?这个好像要 2T 内存

<!-- gh-comment-id:3723442715 --> @KMSorSMS commented on GitHub (Jan 8, 2026): 你得内存大小是多少呢?这个好像要 2T 内存
Author
Owner

@SamsFirth commented on GitHub (Jan 12, 2026):

你得内存大小是多少呢?这个好像要 2T 内存

有两个t,加载完模型剩大约400多g,然后训练开始,之后内存就会不断下降

<!-- gh-comment-id:3736724492 --> @SamsFirth commented on GitHub (Jan 12, 2026): > 你得内存大小是多少呢?这个好像要 2T 内存 有两个t,加载完模型剩大约400多g,然后训练开始,之后内存就会不断下降
Author
Owner

@ovowei commented on GitHub (Jan 22, 2026):

请提供下更详细的配置和运行信息

<!-- gh-comment-id:3783875884 --> @ovowei commented on GitHub (Jan 22, 2026): 请提供下更详细的配置和运行信息
Author
Owner

@SamsFirth commented on GitHub (Jan 27, 2026):

请提供下更详细的配置和运行信息

发现需要在sft/lora.py中的training_step函数中添加每隔几步就回收一次内存的功能就可以解决

<!-- gh-comment-id:3803945150 --> @SamsFirth commented on GitHub (Jan 27, 2026): > 请提供下更详细的配置和运行信息 发现需要在sft/lora.py中的training_step函数中添加每隔几步就回收一次内存的功能就可以解决
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/ktransformers#1115
No description provided.