Skip to content

Remove cudaMalloc and cudaFree in backward#87

Merged
beginlner merged 2 commits intodeepseek-ai:mainfrom
SeanLi-OI:fix/get-rid-of-cudamalloc-and-cudafree
Aug 25, 2025
Merged

Remove cudaMalloc and cudaFree in backward#87
beginlner merged 2 commits intodeepseek-ai:mainfrom
SeanLi-OI:fix/get-rid-of-cudamalloc-and-cudafree

Conversation

@SeanLi-OI
Copy link
Copy Markdown
Contributor

image CudaMalloc and CudaFree cause wait in host side. So replace it with `torch.empty()` which handle alloc failure inside torch and free when destruct.

@beginlner beginlner merged commit eb75833 into deepseek-ai:main Aug 25, 2025
@beginlner
Copy link
Copy Markdown
Collaborator

Thanks! Merged with minor fixes.

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