Skip to content

Conversation

@seagater
Copy link
Contributor

@seagater seagater commented Nov 5, 2025

Use mscclpp::DataType to replace the following types in API interface:
int dtype;
ncclDataType_t dtype;

Add data type conversion:
Convert ncclDataType_t to mscclpp::DataType

Copy link
Contributor

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 PR refactors data type handling by replacing int parameters with a strongly-typed mscclpp::DataType enum throughout the algorithm API. The changes improve type safety and make the API more self-documenting.

  • Introduces DataType enum in executor.hpp and creates helper functions in datatype.hpp
  • Updates all algorithm interfaces to use DataType instead of int
  • Adds conversion functions between NCCL and MSCCL++ data types

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
include/mscclpp/datatype.hpp New header with utility function for getting data type sizes
include/mscclpp/algorithm.hpp Updated algorithm API signatures to use DataType and fixed documentation typo
src/algorithm.cc Updated implementation to use DataType parameter type
apps/nccl/src/datatype_conversion.hpp New conversion functions between NCCL and MSCCL++ data types
apps/nccl/src/nccl.cu Updated to convert NCCL types to MSCCL++ types before API calls
apps/nccl/src/broadcast.hpp Updated function signatures to use DataType
apps/nccl/src/broadcast.cu Updated implementation with type conversions
apps/nccl/src/allreduce.hpp Updated function signatures to use DataType and added trailing whitespace
apps/nccl/src/allreduce.cu Updated implementation with type conversions and error handling
apps/nccl/src/allgather.hpp Updated function signatures to use DataType
apps/nccl/src/allgather.cu Updated implementation with type conversions

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

NumTransports, // The number of transports.
};

/// Data types supported by mscclpp operations.
Copy link
Contributor

Choose a reason for hiding this comment

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

How about move to mscclpp/include/mscclpp/gpu_data_types.hpp

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.

4 participants