Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request implements a token pool for cuCreate API to support inter-node NVL operations and reduce the footprint of cuCreate calls. The TokenPool manages allocation and deallocation of GPU memory tokens using a bitmap-based allocation strategy.
Key Changes
- Introduces a new
TokenPoolclass for efficient token allocation and management - Integrates the token pool into the
Contextclass for centralized token management - Updates semaphore creation to use tokens from the pool instead of individual allocations
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/utils_internal.cc |
Implements the core TokenPool class with bitmap-based allocation |
src/semaphore.cc |
Updates semaphore stub to use context's token pool for GPU token allocation |
src/include/utils_internal.hpp |
Adds TokenPool class declaration |
src/include/context.hpp |
Adds token pool member and getter method to Context::Impl |
src/gpu_utils.cc |
Implements getCuAllocationGranularity helper function |
src/context.cc |
Implements lazy initialization of token pool in Context |
include/mscclpp/gpu_utils.hpp |
Adds declaration for getCuAllocationGranularity function |
include/mscclpp/gpu.hpp |
Adds HIP compatibility definitions for allocation granularity |
include/mscclpp/core.hpp |
Adds friend class declaration for SemaphoreStub access |
Comments suppressed due to low confidence (3)
src/utils_internal.cc:1
- This file is missing the required MIT License header at the top. All source files should include the license header.
// Copyright (c) Microsoft Corporation.
src/include/utils_internal.hpp:1
- This file is missing the required MIT License header at the top. All source files should include the license header.
// Copyright (c) 2016-2022, NVIDIA CORPORATION. All rights reserved.
src/include/context.hpp:1
- This file is missing the required MIT License header at the top. All source files should include the license header.
// Copyright (c) Microsoft Corporation.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
chhwang
requested changes
Oct 24, 2025
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
Author
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
chhwang
approved these changes
Oct 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create a tokenPool to allocate token. This feature is used to support inter node NVL and try to reduce the footprint caused by cuCreate