Skip to content

hotfix: add a switch to disable inplace pinning of tensors#68

Merged
blahgeek merged 3 commits into
MoonshotAI:mainfrom
specture724:fix/default-turn-off-inplace-pin
Dec 18, 2025
Merged

hotfix: add a switch to disable inplace pinning of tensors#68
blahgeek merged 3 commits into
MoonshotAI:mainfrom
specture724:fix/default-turn-off-inplace-pin

Conversation

@specture724

Copy link
Copy Markdown
Contributor

issue #67
Add a switch use_inplace_pin_memory in ParameterServer.register_checkpoint to control the use of in-place pin memory feature. It is False by default

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #67 by adding a configuration switch to control the in-place pin memory feature for tensors stored in /dev/shm/. The feature is now opt-in rather than automatic, with use_inplace_pin_memory defaulting to False for safety.

  • Added use_inplace_pin_memory parameter to ParameterServer.register_checkpoint() method (defaults to False)
  • Modified _register_checkpoint() to conditionally apply in-place pinning based on the new flag
  • Updated test cleanup to use shutil.rmtree() instead of os.removedirs() with clarifying comment

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
checkpoint_engine/ps.py Added use_inplace_pin_memory parameter to control in-place pinning behavior, with corresponding logic changes and documentation
tests/test_update.py Fixed test cleanup method from os.removedirs() to shutil.rmtree() and added comment explaining test requirement

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread checkpoint_engine/ps.py Outdated
Comment thread checkpoint_engine/ps.py Outdated
Comment thread checkpoint_engine/ps.py
specture724 and others added 2 commits December 18, 2025 14:58
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Anjie Hou <149605198+specture724@users.noreply.github.com>
@specture724 specture724 force-pushed the fix/default-turn-off-inplace-pin branch from 0158e7a to 4a21b4f Compare December 18, 2025 07:06
@blahgeek blahgeek merged commit c9a2c6d into MoonshotAI:main Dec 18, 2025
2 checks passed
blahgeek pushed a commit that referenced this pull request Dec 18, 2025
* feat: add a switch to disable inplace pinning of tensors

* Update checkpoint_engine/ps.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Anjie Hou <149605198+specture724@users.noreply.github.com>

* doc

---------

Signed-off-by: Anjie Hou <149605198+specture724@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

3 participants