Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:gouzil/Paddle into sot_support_C…
Browse files Browse the repository at this point in the history
…ALL_INTRINSIC_1
  • Loading branch information
gouzil committed Feb 26, 2024
2 parents cd14707 + ae2d4b9 commit 014bac1
Show file tree
Hide file tree
Showing 586 changed files with 8,597 additions and 4,271 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ performance-move-const-arg,
-performance-move-constructor-init,
-performance-no-automatic-move,
performance-noexcept-move-constructor,
-performance-trivially-destructible,
performance-trivially-destructible,
-performance-type-promotion-in-math-fn,
-performance-unnecessary-copy-initialization,
readability-container-size-empty,
Expand Down
2 changes: 1 addition & 1 deletion cmake/cinn/core.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function(cinn_merge_static_libs TARGET_NAME)
COMMAND ${CMAKE_COMMAND} -E touch ${target_SRCS}
DEPENDS ${libs})

# Generate dummy staic lib
# Generate dummy static lib
file(WRITE ${target_SRCS}
"const char *dummy_${TARGET_NAME} = \"${target_SRCS}\";")
add_library(${TARGET_NAME} STATIC ${target_SRCS})
Expand Down
2 changes: 1 addition & 1 deletion cmake/cinn/external/absl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ExternalProject_Add(
BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_bad_variant_access.a
BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_raw_hash_set.a)

# It may be more convinent if we just include all absl libs
# It may be more convenient if we just include all absl libs
set(ABSL_LIB_NAMES
hash
wyhash
Expand Down
2 changes: 1 addition & 1 deletion cmake/cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ set(CUDA_PROPAGATE_HOST_FLAGS OFF)
# So, don't set these flags here.
set(CMAKE_CUDA_STANDARD 17)

# (Note) For windows, if delete /W[1-4], /W1 will be added defaultly and conflic with -w
# (Note) For windows, if delete /W[1-4], /W1 will be added defaultly and conflict with -w
# So replace /W[1-4] with /W0
if(WIN32)
string(REGEX REPLACE "/W[1-4]" " /W0 " CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS}")
Expand Down
2 changes: 1 addition & 1 deletion cmake/external/cub.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if(${CMAKE_CUDA_COMPILER_VERSION} GREATER_EQUAL 11.6)
set(CUB_TAG 1.16.0)
execute_process(COMMAND git --git-dir=${CUB_SOURCE_DIR}/.git
--work-tree=${CUB_SOURCE_DIR} checkout ${CUB_TAG})
# cub 1.16.0 is not compitable with current thrust version
# cub 1.16.0 is not compatible with current thrust version
add_definitions(-DTHRUST_IGNORE_CUB_VERSION_CHECK)
else()
set(CUB_TAG 1.8.0)
Expand Down
2 changes: 1 addition & 1 deletion cmake/external/lapack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(LAPACK_DOWNLOAD_DIR
set(LAPACK_INSTALL_DIR ${THIRD_PARTY_PATH}/install/lapack)
set(LAPACK_LIB_DIR ${LAPACK_INSTALL_DIR}/lib)

# Note(zhouwei): lapack need fortan compiler which many machines don't have, so use precompiled library.
# Note(zhouwei): lapack need fortran compiler which many machines don't have, so use precompiled library.
# use lapack tag v3.10.0 on 06/28/2021 https://github.com/Reference-LAPACK/lapack
if(LINUX)
set(LAPACK_FILE
Expand Down
2 changes: 1 addition & 1 deletion cmake/external/mklml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if(WIN32)
else()
#TODO(intel-huying):
# Now enable csrmm function in mklml library temporarily,
# it will be updated as offical version later.
# it will be updated as official version later.
set(MKLML_FILE
"csrmm_mklml_lnx_2019.0.5.tgz"
CACHE STRING "" FORCE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/external/protobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ if(WITH_IPU)
elseif(WITH_ARM_BRPC)
set(PROTOBUF_VERSION 21.12-baidu-ee-common)
elseif(WIN32)
#Lower version prootbuf is used for widows
#Lower version protobuf is used for widows
set(PROTOBUF_VERSION 21.12)
else()
set(PROTOBUF_VERSION 21.12)
Expand Down
2 changes: 1 addition & 1 deletion cmake/external/pybind11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if(NOT WIN32)
file(TO_NATIVE_PATH ${PADDLE_SOURCE_DIR}/patches/pybind/cast.h.patch
native_dst)
# Note: [Why calling some `git` commands before `patch`?]
# Paddle's CI uses cache to accelarate the make process. However, error might raise when patch codes in two scenarios:
# Paddle's CI uses cache to accelerate the make process. However, error might raise when patch codes in two scenarios:
# 1. Patch to the wrong version: the tag version of CI's cache falls behind PYBIND_TAG, use `git checkout ${PYBIND_TAG}` to solve this.
# 2. Patch twice: the tag version of cache == PYBIND_TAG, but patch has already applied to cache.
set(PYBIND_PATCH_COMMAND
Expand Down
2 changes: 1 addition & 1 deletion cmake/external/xpu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if(NOT DEFINED XPU_BASE_DATE)
set(XPU_BASE_DATE "20240104")
endif()
if(NOT DEFINED XPU_XHPC_BASE_DATE)
set(XPU_XHPC_BASE_DATE "20240218")
set(XPU_XHPC_BASE_DATE "20240222")
endif()
set(XPU_XCCL_BASE_VERSION "1.1.8.1")
if(NOT DEFINED XPU_XFT_BASE_VERSION)
Expand Down
2 changes: 1 addition & 1 deletion cmake/flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function(CheckCompilerCXX14Flag)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID
STREQUAL "Clang")
# cmake >= 3.0 compiler id "AppleClang" on Mac OS X, otherwise "Clang"
# Apple Clang is a different compiler than upstream Clang which havs different version numbers.
# Apple Clang is a different compiler than upstream Clang which has different version numbers.
# https://gist.github.com/yamaya/2924292
if(APPLE) # cmake < 3.0 compiler id "Clang" on Mac OS X
if(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 5.1)
Expand Down
18 changes: 9 additions & 9 deletions cmake/generic.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#
# nv_library(example SRCS example.cu)
#
# To specify that a library new_example.a depends on other libraies:
# To specify that a library new_example.a depends on other libraries:
#
# cc_library(new_example SRCS new_example.cc DEPS example)
#
Expand Down Expand Up @@ -72,7 +72,7 @@
# nv_test(example_test SRCS example_test.cu DEPS example)
#
# It is pretty often that executable and test binaries depend on
# pre-defined external libaries like glog and gflags defined in
# pre-defined external libraries like glog and gflags defined in
# /cmake/external/*.cmake:
#
# cc_test(example_test SRCS example_test.cc DEPS example glog gflags)
Expand Down Expand Up @@ -257,7 +257,7 @@ function(merge_static_libs TARGET_NAME)
COMMAND ${CMAKE_COMMAND} -E touch ${target_SRCS}
DEPENDS ${libs})

# Generate dummy staic lib
# Generate dummy static lib
generate_dummy_static_lib(LIB_NAME ${TARGET_NAME} FILE_PATH ${target_SRCS}
GENERATOR "generic.cmake:merge_static_libs")
target_link_libraries(${TARGET_NAME} ${libs_deps})
Expand Down Expand Up @@ -310,7 +310,7 @@ function(merge_static_libs TARGET_NAME)
foreach(lib ${libs})
set(libfiles ${libfiles} $<TARGET_FILE:${lib}>)
endforeach()
# msvc compiler will put libarary in directory of "/Release/xxxlib" by default
# msvc compiler will put library in directory of "/Release/xxxlib" by default
add_custom_command(
TARGET ${TARGET_NAME}
POST_BUILD
Expand Down Expand Up @@ -530,7 +530,7 @@ function(cc_test TARGET_NAME)
"${multiValueArgs}" ${ARGN})
if(WIN32)
# NOTE(zhiqiu): on windows platform, the symbols should be exported
# explicitly by __declspec(dllexport), however, there are serveral
# explicitly by __declspec(dllexport), however, there are several
# symbols not exported, and link error occurs.
# so, the tests are not built against dynamic libraries now.
cc_test_old(
Expand Down Expand Up @@ -577,7 +577,7 @@ function(cc_test_old TARGET_NAME)
cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
cc_test_build(${TARGET_NAME} SRCS ${cc_test_SRCS} DEPS ${cc_test_DEPS})
# we dont test hcom op, because it need complex configuration
# we donot test hcom op, because it need complex configuration
# with more than one machine
cc_test_run(${TARGET_NAME} COMMAND ${TARGET_NAME} ARGS ${cc_test_ARGS})
elseif(WITH_TESTING AND NOT TEST ${TARGET_NAME})
Expand Down Expand Up @@ -809,7 +809,7 @@ function(hip_binary TARGET_NAME)
set(multiValueArgs SRCS DEPS)
cmake_parse_arguments(hip_binary "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
# FindHIP.cmake defined hip_add_executable, HIP_SOURCE_PROPERTY_FORMAT is requried for .cc files
# FindHIP.cmake defined hip_add_executable, HIP_SOURCE_PROPERTY_FORMAT is required for .cc files
hip_add_executable(${TARGET_NAME} ${hip_binary_SRCS})
if(hip_binary_DEPS)
target_link_libraries(${TARGET_NAME} ${hip_binary_DEPS})
Expand All @@ -826,7 +826,7 @@ function(hip_test TARGET_NAME)
cmake_parse_arguments(hip_test "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
# FindHIP.cmake defined hip_add_executable,
# HIP_SOURCE_PROPERTY_FORMAT is requried for .cc files
# HIP_SOURCE_PROPERTY_FORMAT is required for .cc files
hip_add_executable(${TARGET_NAME} ${hip_test_SRCS})
# "-pthread -ldl -lrt" is defined in CMAKE_CXX_LINK_EXECUTABLE
target_link_options(${TARGET_NAME} PRIVATE -pthread -ldl -lrt)
Expand Down Expand Up @@ -1231,7 +1231,7 @@ function(grpc_library TARGET_NAME)
get_filename_component(PROTO_WE ${grpc_library_PROTO} NAME_WE)
get_filename_component(PROTO_PATH ${ABS_PROTO} PATH)

# FIXME(putcn): the follwoing line is supposed to generate *.pb.h and cc, but
# FIXME(putcn): the following line is supposed to generate *.pb.h and cc, but
# somehow it didn't. line 602 to 604 is to patching this. Leaving this here
# for now to enable dist CI.
paddle_protobuf_generate_cpp(grpc_proto_srcs grpc_proto_hdrs "${ABS_PROTO}")
Expand Down
6 changes: 3 additions & 3 deletions cmake/inference_lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function(copy TARGET)
endforeach()
endfunction()

function(copy_part_of_thrid_party TARGET DST)
function(copy_part_of_third_party TARGET DST)
if(${CBLAS_PROVIDER} STREQUAL MKLML)
set(dst_dir "${DST}/third_party/install/mklml")
if(WIN32)
Expand Down Expand Up @@ -233,7 +233,7 @@ copy(
SRCS ${CMAKE_CURRENT_BINARY_DIR}/CMakeCache.txt
DSTS ${PADDLE_INFERENCE_INSTALL_DIR})

copy_part_of_thrid_party(inference_lib_dist ${PADDLE_INFERENCE_INSTALL_DIR})
copy_part_of_third_party(inference_lib_dist ${PADDLE_INFERENCE_INSTALL_DIR})

set(src_dir "${PADDLE_SOURCE_DIR}/paddle/fluid")

Expand Down Expand Up @@ -365,7 +365,7 @@ add_custom_command(
set(PADDLE_INFERENCE_C_INSTALL_DIR
"${CMAKE_BINARY_DIR}/paddle_inference_c_install_dir"
CACHE STRING "A path setting CAPI paddle inference shared")
copy_part_of_thrid_party(inference_lib_dist ${PADDLE_INFERENCE_C_INSTALL_DIR})
copy_part_of_third_party(inference_lib_dist ${PADDLE_INFERENCE_C_INSTALL_DIR})

set(src_dir "${PADDLE_SOURCE_DIR}/paddle/fluid")
if(WIN32)
Expand Down
4 changes: 2 additions & 2 deletions cmake/init.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ else()
set(CMAKE_CUDA_FLAGS_MINSIZEREL "-Xcompiler=\"-MD -O1 -Ob1\" -DNDEBUG")
endif()

# It can specify CUDA compile flag manualy,
# its use is to remvoe /Zi to reduce GPU static library size. But it's dangerous
# It can specify CUDA compile flag manually,
# its use is to remove /Zi to reduce GPU static library size. But it's dangerous
# because CUDA will update by nvidia, then error will occur.
# Now, it's only used in VS2015 + CUDA:[10.0, 10.2]
set(WIN_PROPS ${CMAKE_SOURCE_DIR}/cmake/paddle_win.props)
Expand Down
4 changes: 2 additions & 2 deletions cmake/phi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function(kernel_declare TARGET_LIST)
is_all_backend
"${first_registry}")
if(NOT is_all_backend STREQUAL "")
# parse the registerd kernel message
# parse the registered kernel message
string(
REPLACE "PD_REGISTER_KERNEL_FOR_ALL_BACKEND_DTYPE_EXCEPT_CUSTOM("
"" kernel_msg "${first_registry}")
Expand All @@ -131,7 +131,7 @@ function(kernel_declare TARGET_LIST)
is_all_backend
"${first_registry}")

# parse the registerd kernel message
# parse the registered kernel message
string(REPLACE "PD_REGISTER_KERNEL_FOR_ALL_BACKEND_DTYPE(" ""
kernel_msg "${first_registry}")
endif()
Expand Down
14 changes: 7 additions & 7 deletions cmake/third_party.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

include(ExternalProject)
# Creat a target named "third_party", which can compile external dependencies on all platform(windows/linux/mac)
# Create a target named "third_party", which can compile external dependencies on all platform(windows/linux/mac)

set(THIRD_PARTY_PATH
"${CMAKE_BINARY_DIR}/third_party"
Expand Down Expand Up @@ -46,7 +46,7 @@ if(NOT WITH_SETUP_INSTALL)
endif()

execute_process(
COMMAND git submodule update --init --recursive --force
COMMAND git submodule update --init --recursive
WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}
RESULT_VARIABLE result_var)
if(NOT result_var EQUAL 0)
Expand All @@ -55,16 +55,16 @@ if(NOT WITH_SETUP_INSTALL)
endif()

endif()
# cache funciton to avoid repeat download code of third_party.
# This function has 4 parameters, URL / REPOSITOR / TAG / DIR:
# cache function to avoid repeat download code of third_party.
# This function has 4 parameters, URL / REPOSITORY / TAG / DIR:
# 1. URL: specify download url of 3rd party
# 2. REPOSITORY: specify git REPOSITORY of 3rd party
# 3. TAG: specify git tag/branch/commitID of 3rd party
# 4. DIR: overwrite the original SOURCE_DIR when cache directory
#
# The function Return 1 PARENT_SCOPE variables:
# - ${TARGET}_DOWNLOAD_CMD: Simply place "${TARGET}_DOWNLOAD_CMD" in ExternalProject_Add,
# and you no longer need to set any donwnload steps in ExternalProject_Add.
# and you no longer need to set any download steps in ExternalProject_Add.
# For example:
# Cache_third_party(${TARGET}
# REPOSITORY ${TARGET_REPOSITORY}
Expand Down Expand Up @@ -145,10 +145,10 @@ macro(UNSET_VAR VAR_NAME)
unset(${VAR_NAME})
endmacro()

# Funciton to Download the dependencies during compilation
# Function to Download the dependencies during compilation
# This function has 2 parameters, URL / DIRNAME:
# 1. URL: The download url of 3rd dependencies
# 2. NAME: The name of file, that determin the dirname
# 2. NAME: The name of file, that determine the dirname
#
function(file_download_and_uncompress URL NAME)
set(options "")
Expand Down
4 changes: 2 additions & 2 deletions cmake/unity_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ endfunction()
# If the source file does not hit any registed groups, use itself.
# This function put the actual combination relationship in variables instead of
# writing the unity source file. The reason is that writing unity source file
# will change the timestampe and affect the effect of retaining the build
# will change the timestamp and affect the effect of retaining the build
# directory on Windows.
# Here you need to specify the source type which belongs to cc or cu.
function(compose_unity_target_sources TARGET TYPE)
Expand All @@ -84,7 +84,7 @@ function(compose_unity_target_sources TARGET TYPE)
PROPERTY ${TARGET}_${TYPE}_group_index)
foreach(src ${ARGN})
set(unity_file "")
# Note(zhouwei25): UB use the path releative to CMAKE_SOURCE_DIR.
# Note(zhouwei25): UB use the path relative to CMAKE_SOURCE_DIR.
# If use absolute path, sccache/ccache hit rate will be reduced.
if(IS_ABSOLUTE ${src})
set(src_absolute_path ${src})
Expand Down
2 changes: 1 addition & 1 deletion paddle/cinn/backends/codegen_cuda_dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ void CodeGenCUDA_Dev::Visit(const ir::Let *op) {
str_ += " ";
IrPrinter::Visit(op->symbol);
vectorized_tensor_names_.insert(utils::GetStreamCnt(op->symbol));
// skip "=0" in "half8 temp = 0;" sincethe operator= of half8 may not
// skip "=0" in "half8 temp = 0;" since the operator= of half8 may not
// overloaded.
if (op->body.As<ir::IntImm>() && op->body.As<ir::IntImm>()->value == 0) {
return;
Expand Down
4 changes: 2 additions & 2 deletions paddle/cinn/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ gather_srcs(
ir_util.cc
test_helper.cc
# cuda_test_helper.cc
arithmatic.cc
arithmetic.cc
cas.cc
union_find.cc
python_interpreter_guard.cc
Expand All @@ -36,7 +36,7 @@ cinn_cc_test(test_topo_walker SRCS topo_walker_test.cc DEPS gtest glog)
cinn_cc_test(test_cinn_value SRCS cinn_value_test.cc DEPS cinncore)
cinn_cc_test(test_shared SRCS shared_test.cc DEPS cinncore)
cinn_cc_test(test_graph_utils SRCS graph_utils_test.cc DEPS cinncore)
cinn_cc_test(test_arithmatic SRCS arithmatic_test.cc DEPS cinncore)
cinn_cc_test(test_arithmetic SRCS arithmetic_test.cc DEPS cinncore)
cinn_cc_test(test_cas SRCS cas_test.cc DEPS cinncore)
cinn_cc_test(test_type SRCS type_test.cc DEPS cinncore)
cinn_cc_test(test_axis SRCS axis_test.cc DEPS cinncore)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "paddle/cinn/common/arithmatic.h"
#include "paddle/cinn/common/arithmetic.h"

#include <map>
#include <mutex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
// limitations under the License.

/**
* This file includes some arithmatic utilities, such as simplifying/solving a
* This file includes some arithmetic utilities, such as simplifying/solving a
* math equation/CINN expression.
*/
#pragma once

#include "paddle/cinn/ir/ir.h"
#include "paddle/cinn/ir/ir.h" // NOLINT, Should be in front of other header files

#include <ginac/ginac.h>
#include <ginac/ginac.h> // NOLINT

#include <limits>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <limits> // NOLINT
#include <map> // NOLINT
#include <set> // NOLINT
#include <string> // NOLINT
#include <tuple> // NOLINT

#ifdef As
#undef As
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "paddle/cinn/common/arithmatic.h"
#include "paddle/cinn/common/arithmetic.h"

#include <ginac/ginac.h>
#include <glog/logging.h>
Expand Down
2 changes: 1 addition & 1 deletion paddle/cinn/common/cas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <string>
#include <utility>

#include "paddle/cinn/common/arithmatic.h"
#include "paddle/cinn/common/arithmetic.h"
#include "paddle/cinn/common/ir_util.h"
#include "paddle/cinn/ir/ir_mutator.h"
#include "paddle/cinn/ir/ir_printer.h"
Expand Down
2 changes: 1 addition & 1 deletion paddle/cinn/common/integer_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "paddle/cinn/common/integer_set.h"

#include "paddle/cinn/common/arithmatic.h"
#include "paddle/cinn/common/arithmetic.h"
#include "paddle/cinn/ir/ir_mutator.h"
#include "paddle/cinn/ir/op/ir_operators.h"
#include "paddle/cinn/ir/utils/ir_copy.h"
Expand Down
Loading

0 comments on commit 014bac1

Please sign in to comment.