-
Notifications
You must be signed in to change notification settings - Fork 72
Revise the mscclpp datatype #671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
DataTypeenum inexecutor.hppand creates helper functions indatatype.hpp - Updates all algorithm interfaces to use
DataTypeinstead ofint - 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.
…e difinition of getDataTypeSizer to datype_conversion.hpp
| NumTransports, // The number of transports. | ||
| }; | ||
|
|
||
| /// Data types supported by mscclpp operations. |
There was a problem hiding this comment.
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
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