From 91609be0ef155801396863c145b191543365c6b6 Mon Sep 17 00:00:00 2001 From: akolliasAMD <99202231+akolliasAMD@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:21:37 -0600 Subject: [PATCH] Revert "adding git version to rccl-test (#66)" This reverts commit a31679775ce521825b3baab8aeed7af1d08d3560. --- src/CMakeLists.txt | 15 +-------- src/cmake/git_version.cmake | 62 ------------------------------------- src/common.cu | 2 -- src/git_version.h | 7 ----- 4 files changed, 1 insertion(+), 85 deletions(-) delete mode 100644 src/cmake/git_version.cmake delete mode 100644 src/git_version.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9b99ac1067..2ae943b13e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -68,7 +68,6 @@ endfunction() # Collect list of common source files #================================================================================================== set(COMMON_FILES - git_version.h common.h common.cu nccl1_compat.h @@ -113,20 +112,8 @@ endforeach() # Compile common object library #================================================================================================== add_custom_target(hipify DEPENDS ${HIP_COMMON_SOURCES}) - -# Create an initial git_version.cpp file (that will be updated with latest git version) -#================================================================================================== -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/git_version.cpp "") -list(APPEND HIP_COMMON_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/git_version.cpp) - -#Create a custom target that updates git_version.cpp and executes whenever rccl is built -add_custom_target(git_version_check - COMMENT "Updating git_version.cpp if necessary" - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/git_version.cmake - VERBATIM -) add_library(rccl_common OBJECT ${HIP_COMMON_SOURCES}) -add_dependencies(rccl_common hipify git_version_check) +add_dependencies(rccl_common hipify) target_link_libraries(rccl_common roc::rccl hip::device) if(USE_MPI) target_link_libraries(rccl_common MPI::MPI_CXX) diff --git a/src/cmake/git_version.cmake b/src/cmake/git_version.cmake deleted file mode 100644 index c320f0ca60..0000000000 --- a/src/cmake/git_version.cmake +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -# Attempt to collect the latest git hash -execute_process(COMMAND git log --pretty=format:'%h' -n 1 - OUTPUT_VARIABLE GIT_REV - ERROR_QUIET) - -# Check if git information was found -if ("${GIT_REV}" STREQUAL "") - set(CURR_GIT_VERSION "const char *rcclTestsGitHash =\"Unknown \";") -else() - # Check for changes (denote with a '+') after hash - execute_process( - COMMAND bash -c "git diff --quiet --exit-code || echo +" - OUTPUT_VARIABLE GIT_DIFF) - # Collect branch information - execute_process( - COMMAND git rev-parse --abbrev-ref HEAD - OUTPUT_VARIABLE GIT_BRANCH) - - string(STRIP "${GIT_REV}" GIT_REV) - string(SUBSTRING "${GIT_REV}" 1 7 GIT_REV) - string(STRIP "${GIT_DIFF}" GIT_DIFF) - string(STRIP "${GIT_BRANCH}" GIT_BRANCH) - - set(CURR_GIT_VERSION "const char *rcclTestsGitHash =\"${GIT_BRANCH}:${GIT_REV}${GIT_DIFF}\";") -endif() - -# Compare file with older git version file (git_version.cpp) -if (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/git_version.cpp) - #MESSAGE(STATUS "Found ${CMAKE_CURRENT_BINARY_DIR}/git_version.cpp") - file(READ ${CMAKE_CURRENT_BINARY_DIR}/git_version.cpp PREV_GIT_VERSION) - #message(STATUS "CURR GIT version: ${CURR_GIT_VERSION}") - #message(STATUS "PREV GIT version: ${PREV_GIT_VERSION}") - if (NOT "${CURR_GIT_VERSION}" STREQUAL "${PREV_GIT_VERSION}") - message(STATUS "Updating git_version.cpp") - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/git_version.cpp "${CURR_GIT_VERSION}") - else() - message(STATUS "No changes to git_version.cpp required") - endif() -else() - # Create git_version.cpp if it doesn't exist yet - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/git_version.cpp "${CURR_GIT_VERSION}") -endif() diff --git a/src/common.cu b/src/common.cu index 4534d10131..dd9add2383 100644 --- a/src/common.cu +++ b/src/common.cu @@ -21,7 +21,6 @@ //#define DEBUG_PRINT #include "verifiable.h" -#include "git_version.h" int test_ncclVersion = 0; // init'd with ncclGetVersion() @@ -755,7 +754,6 @@ testResult_t run(); // Main function int main(int argc, char* argv[]) { // Make sure everyline is flushed so that we see the progress of the test setlinebuf(stdout); - printf("rccl-tests: Version %s\n", rcclTestsGitHash); #if NCCL_VERSION_CODE >= NCCL_VERSION(2,4,0) ncclGetVersion(&test_ncclVersion); diff --git a/src/git_version.h b/src/git_version.h deleted file mode 100644 index 861c0fe970..0000000000 --- a/src/git_version.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef RCCL_TESTS_GIT_VERSION_H_ -#define RCCL_TESTS_GIT_VERSION_H_ - -extern const char *rcclTestsGitHash; - -#endif -