Skip to content

Conversation

Binyang2014
Copy link
Contributor

@Binyang2014 Binyang2014 commented Sep 8, 2025

Create a tokenPool to allocate token. This feature is used to support inter node NVL and try to reduce the footprint caused by cuCreate

@Binyang2014 Binyang2014 marked this pull request as ready for review September 9, 2025 21:03
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

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 TokenPool class for efficient token allocation and management
  • Integrates the token pool into the Context class 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.

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