Skip to content

Directly import sysconfig + Remove Multidevice "Memory Leak" - #137

Merged
vbharadwaj-bk merged 2 commits into
mainfrom
sysconfig_and_memleak
Jun 20, 2025
Merged

Directly import sysconfig + Remove Multidevice "Memory Leak"#137
vbharadwaj-bk merged 2 commits into
mainfrom
sysconfig_and_memleak

Conversation

@vbharadwaj-bk

Copy link
Copy Markdown
Member

distutils will be deprecated in future Python versions, hence the direct call. Calling cudaFree(0) when CUJITKernel is initiated initializes the primary context on device 0 for any process, leading to extra memory consumption on device 0 when multiple devices are used. CUDA contexts can take 0.4-1 GB, so this is nontrivial overhead that we are eliminating.

@vbharadwaj-bk vbharadwaj-bk changed the title Directly import sysconfig + Remove Multidevice Memory Leak Directly import sysconfig + Remove Multidevice "Memory Leak" Jun 20, 2025
@vbharadwaj-bk vbharadwaj-bk added the ci-ready Triggers CI checks for a pull request label Jun 20, 2025
@vbharadwaj-bk
vbharadwaj-bk merged commit 1ab6c65 into main Jun 20, 2025
@vbharadwaj-bk vbharadwaj-bk linked an issue Jun 20, 2025 that may be closed by this pull request
vbharadwaj-bk added a commit that referenced this pull request Jun 21, 2025
* Directly import sysconfig + Remove Multidevice "Memory Leak" (#137)

* Eliminated cudaFree(0), directly imported sysconfig.

* Linted.

* Zero-initialized L1, L2 gradient buffers to avoid garbage accumulation. (#138)
@vbharadwaj-bk
vbharadwaj-bk deleted the sysconfig_and_memleak branch June 21, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-ready Triggers CI checks for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible GPU0 memory leak when using DDP

1 participant