Skip to content

Conversation

@changeyoung98
Copy link
Contributor

PR Category

Execute Infrastructure

PR Types

Performance

Description

pcard-67164
Fix save combine memory
save_combine存储参数时为保持save_to_memory参数的处理逻辑一致,会统一使用ostringstream 进行序列化,之后根据保存到内存或是文件中再做区分。这样在写入文件时再次构造ofstream 导致最大内存占用为参数量大小的二倍,在参数量大的模型上会造成OOM。
修改了旧IR SaveCombineTensorKernel 和PIR SaveCombineFunction 中的序列化逻辑,其中SaveCombineTensorKernel 中根据是否保存到内存中创建不同的二进制流传入序列化函数,避免二次内存占用。

@paddle-bot
Copy link

paddle-bot bot commented Nov 25, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@changeyoung98 changeyoung98 merged commit 28137ec into PaddlePaddle:develop Nov 26, 2024
27 of 28 checks passed
@changeyoung98 changeyoung98 deleted the czy-saveload branch November 26, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants