Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,13 @@ jobs:
- name: Update Version in Files
run: |
VERSION=${{ env.VERSION }}
sed -i "s/^version: .*/version: ${VERSION}/" CITATION.cff
sed -i "s/^release = \".*\"/release = \"v${VERSION}\"/" docs/conf.py
sed -i "s/^version = \".*\"/version = \"${VERSION}\"/" pyproject.toml

IFS='.' read -ra VER <<< "$VERSION"
MAJOR=${VER[0]}
MINOR=${VER[1]}
PATCH=${VER[2]}

# Update CMakeLists.txt
sed -i "s/set(MSCCLPP_MAJOR \".*\")/set(MSCCLPP_MAJOR \"${MAJOR}\")/" CMakeLists.txt
sed -i "s/set(MSCCLPP_MINOR \".*\")/set(MSCCLPP_MINOR \"${MINOR}\")/" CMakeLists.txt
sed -i "s/set(MSCCLPP_PATCH \".*\")/set(MSCCLPP_PATCH \"${PATCH}\")/" CMakeLists.txt

# Update header files
sed -i "s/#define MSCCLPP_MAJOR .*/#define MSCCLPP_MAJOR ${MAJOR}/" include/mscclpp/core.hpp
sed -i "s/#define MSCCLPP_MINOR .*/#define MSCCLPP_MINOR ${MINOR}/" include/mscclpp/core.hpp
sed -i "s/#define MSCCLPP_PATCH .*/#define MSCCLPP_PATCH ${PATCH}/" include/mscclpp/core.hpp

- name: Commit and Push Changes
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add CITATION.cff docs/conf.py include/mscclpp/core.hpp pyproject.toml || true
git add CITATION.cff docs/conf.py || true
if git diff --cached --exit-code; then
echo "No changes to commit."
else
Expand Down
26 changes: 24 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

cmake_minimum_required(VERSION 3.25)
project(mscclpp LANGUAGES CXX)

file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" MSCCLPP_VERSION_CONTENT)
if(MSCCLPP_VERSION_CONTENT MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
set(MSCCLPP_MAJOR "${CMAKE_MATCH_1}")
Expand All @@ -13,8 +16,27 @@ endif()
set(MSCCLPP_SOVERSION ${MSCCLPP_MAJOR})
set(MSCCLPP_VERSION "${MSCCLPP_MAJOR}.${MSCCLPP_MINOR}.${MSCCLPP_PATCH}")

cmake_minimum_required(VERSION 3.25)
project(mscclpp LANGUAGES CXX)
find_package(Git)
set(GIT_HASH "UNKNOWN")
if(Git_FOUND)
execute_process(
COMMAND "${GIT_EXECUTABLE}" rev-parse --short=12 HEAD
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE _git_out
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT _git_out STREQUAL "")
set(GIT_HASH "${_git_out}")
endif()
else()
message(WARNING "Git not found, setting GIT_HASH to 'UNKNOWN'")
endif()

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/include/mscclpp/version.hpp.in"
"${CMAKE_CURRENT_BINARY_DIR}/include/mscclpp/version.hpp"
@ONLY
)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

Expand Down
1 change: 1 addition & 0 deletions docs/programming_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ This section provides advanced topics and best practices for using MSCCL++. It i
guide/advanced-connections
guide/cpp-examples
guide/mscclpp-dsl
guide/customized-algorithm-with-nccl-api
8 changes: 6 additions & 2 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS *.hpp)
target_sources(mscclpp_obj PUBLIC FILE_SET HEADERS FILES ${HEADERS})
file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS *.hpp ${CMAKE_CURRENT_BINARY_DIR}/*.hpp)
target_sources(
mscclpp_obj PUBLIC FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
FILES ${HEADERS}
)
6 changes: 1 addition & 5 deletions include/mscclpp/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
#ifndef MSCCLPP_CORE_HPP_
#define MSCCLPP_CORE_HPP_

#define MSCCLPP_MAJOR 0
#define MSCCLPP_MINOR 7
#define MSCCLPP_PATCH 0
#define MSCCLPP_VERSION (MSCCLPP_MAJOR * 10000 + MSCCLPP_MINOR * 100 + MSCCLPP_PATCH)

#include <array>
#include <bitset>
#include <future>
#include <memory>
#include <mscclpp/errors.hpp>
#include <mscclpp/version.hpp>
#include <string>
#include <vector>

Expand Down
13 changes: 13 additions & 0 deletions include/mscclpp/version.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

#ifndef MSCCLPP_VERSION_HPP_
#define MSCCLPP_VERSION_HPP_

#define MSCCLPP_MAJOR @MSCCLPP_MAJOR@
#define MSCCLPP_MINOR @MSCCLPP_MINOR@
#define MSCCLPP_PATCH @MSCCLPP_PATCH@
#define MSCCLPP_VERSION (MSCCLPP_MAJOR * 10000 + MSCCLPP_MINOR * 100 + MSCCLPP_PATCH)
#define MSCCLPP_GIT_COMMIT "@GIT_HASH@"

#endif // MSCCLPP_VERSION_HPP_
2 changes: 2 additions & 0 deletions python/mscclpp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_version.py
PKG-INFO
Loading