From ccea6ddac36b35aba04126d855114c4a48838041 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Wed, 18 Jun 2025 00:10:59 +0800 Subject: [PATCH] [BE] fix typos in cmake/ (#156079) Pull Request resolved: https://github.com/pytorch/pytorch/pull/156079 Approved by: https://github.com/Skylion007 --- .lintrunner.toml | 1 - cmake/Codegen.cmake | 6 +++--- cmake/DebugHelper.cmake | 2 +- cmake/Dependencies.cmake | 6 +++--- cmake/Modules/FindARM.cmake | 2 +- cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake | 8 ++++---- cmake/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake | 2 +- cmake/iOS.cmake | 2 +- cmake/public/cuda.cmake | 2 +- 9 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.lintrunner.toml b/.lintrunner.toml index 3a543dcc7cb9..a96fdff0a183 100644 --- a/.lintrunner.toml +++ b/.lintrunner.toml @@ -1160,7 +1160,6 @@ exclude_patterns = [ # as necessary 'aten/**', 'c10/**', - 'cmake/**', 'docs/**', 'functorch/**', 'scripts/**', diff --git a/cmake/Codegen.cmake b/cmake/Codegen.cmake index f88c46ae7e70..9a562daf7d16 100644 --- a/cmake/Codegen.cmake +++ b/cmake/Codegen.cmake @@ -35,7 +35,7 @@ endfunction() ################################################################################ -# -- [ Deterine commit hash +# -- [ Determine commit hash execute_process( COMMAND "${Python_EXECUTABLE}" -c "from tools.generate_torch_version import get_sha;print(get_sha('.'), end='')" OUTPUT_VARIABLE COMMIT_SHA @@ -81,7 +81,7 @@ if(INTERN_BUILD_ATEN_OPS) if(USE_CUDA) # The stable/nightly builds do not enable some SM architectures, # like 89/90a/100a. Still, some files need to be built for these - # architecturs specifically. This function makes it possible to + # architectures specifically. This function makes it possible to # enable building given file for a specific such architecture, in # case if PyTorch is built for corresponding other architecture; # for example, it will enable building for SM 90a in case PyTorch @@ -408,7 +408,7 @@ if(INTERN_BUILD_ATEN_OPS) list(LENGTH CPU_CAPABILITY_NAMES NUM_CPU_CAPABILITY_NAMES) math(EXPR NUM_CPU_CAPABILITY_NAMES "${NUM_CPU_CAPABILITY_NAMES}-1") - # The sources list might get reordered later based on the capabilites. + # The sources list might get reordered later based on the capabilities. # See NOTE [ Linking AVX and non-AVX files ] foreach(i RANGE ${NUM_CPU_CAPABILITY_NAMES}) function(process_vec NAME) diff --git a/cmake/DebugHelper.cmake b/cmake/DebugHelper.cmake index 3797a472336f..f69603fb7200 100644 --- a/cmake/DebugHelper.cmake +++ b/cmake/DebugHelper.cmake @@ -1,5 +1,5 @@ function(print_target_properties tgt) - # Get all propreties that cmake supports + # Get all properties that cmake supports execute_process(COMMAND cmake --help-property-list OUTPUT_VARIABLE CMAKE_PROPERTY_LIST) # Convert command output into a CMake list diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index fac87cb3c11b..a5e6e756b064 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -1151,7 +1151,7 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE) set(CMAKE_POLICY_VERSION_MINIMUM 3.5) endif() add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/tensorpipe) - # Suppress warning to unblock libnop comiplation by clang-17 + # Suppress warning to unblock libnop compilation by clang-17 # See https://github.com/pytorch/pytorch/issues/151316 target_compile_options_if_supported(tensorpipe -Wno-missing-template-arg-list-after-template-kw) if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.0.0") @@ -1203,7 +1203,7 @@ if(USE_GLOO) endif() set(GLOO_USE_CUDA_TOOLKIT ON CACHE BOOL "" FORCE) - # Disable NCCL/RCCL since we don't use Gloo+NCCL, make sure to reenable it! + # Disable NCCL/RCCL since we don't use Gloo+NCCL, make sure to re-enable it! set(USE_NCCL_SAVED ${USE_NCCL}) set(USE_RCCL_SAVED ${USE_RCCL}) set(USE_NCCL OFF) @@ -1214,7 +1214,7 @@ if(USE_GLOO) # Here is a little bit hacky. We have to put PROJECT_BINARY_DIR in front # of PROJECT_SOURCE_DIR with/without conda system. The reason is that - # gloo generates a new config.h in the binary diretory. + # gloo generates a new config.h in the binary directory. include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/gloo) include_directories(BEFORE SYSTEM ${PROJECT_BINARY_DIR}/third_party/gloo) else() diff --git a/cmake/Modules/FindARM.cmake b/cmake/Modules/FindARM.cmake index 79fc772eed11..903025c5c2cf 100644 --- a/cmake/Modules/FindARM.cmake +++ b/cmake/Modules/FindARM.cmake @@ -89,7 +89,7 @@ if(NOT CORTEXA9_FOUND) endif(NOT CORTEXA9_FOUND) mark_as_advanced(NEON_FOUND) -#SVE support is availale is only for Linux OS. +#SVE support is available is only for Linux OS. IF(CMAKE_SYSTEM_NAME MATCHES "Linux") # Include necessary modules for checking C and C++ source compilations INCLUDE(CheckCSourceCompiles) diff --git a/cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake b/cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake index f642072bdc51..9daa571955d4 100644 --- a/cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake +++ b/cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake @@ -909,7 +909,7 @@ mark_as_advanced(CUDA_cupti_LIBRARY) # Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are # using the CUDA runtime. For the dynamic version of the runtime, most of the -# dependencies are brough in, but for the static version there are additional libraries +# dependencies are brought in, but for the static version there are additional libraries # and linker commands needed. # Initialize to empty set(CUDA_LIBRARIES) @@ -1202,7 +1202,7 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path) # Only deal with CMake style paths from here on out file(TO_CMAKE_PATH "${path}" bpath) if (IS_ABSOLUTE "${bpath}") - # Absolute paths are generally unnessary, especially if something like + # Absolute paths are generally unnecessary, especially if something like # file(GLOB_RECURSE) is used to pick up the files. string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos) @@ -1225,7 +1225,7 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path) # Avoid spaces string(REPLACE " " "_" bpath "${bpath}") - # Strip off the filename. I wait until here to do it, since removin the + # Strip off the filename. I wait until here to do it, since removing the # basename can make a path that looked like path/../basename turn into # path/.. (notice the trailing slash). get_filename_component(bpath "${bpath}" PATH) @@ -1725,7 +1725,7 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options list(APPEND flags -Xcompiler ${f}) endforeach() - # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags + # Add our general CUDA_NVCC_FLAGS with the configuration specific flags set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") diff --git a/cmake/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake b/cmake/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake index 9293df3aafbd..59c5c11a1091 100644 --- a/cmake/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake +++ b/cmake/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake @@ -156,7 +156,7 @@ macro(cuda_execute_process status command) # copy and paste a runnable command line. set(cuda_execute_process_string) foreach(arg ${ARGN}) - # If there are quotes, excape them, so they come through. + # If there are quotes, escape them, so they come through. string(REPLACE "\"" "\\\"" arg ${arg}) # Args with spaces need quotes around them to get them to be parsed as a single argument. if(arg MATCHES " ") diff --git a/cmake/iOS.cmake b/cmake/iOS.cmake index 9ca91304d5fd..ebf30504feab 100644 --- a/cmake/iOS.cmake +++ b/cmake/iOS.cmake @@ -100,7 +100,7 @@ if(IOS_DEPLOYMENT_TARGET) set(XCODE_IOS_PLATFORM_VERSION_FLAGS "-m${XCODE_IOS_PLATFORM}-version-min=${IOS_DEPLOYMENT_TARGET}") endif() -# Hidden visibilty is required for cxx on iOS +# Hidden visibility is required for cxx on iOS set(CMAKE_C_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS}") set(CMAKE_CXX_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fvisibility-inlines-hidden") diff --git a/cmake/public/cuda.cmake b/cmake/public/cuda.cmake index 95a12605ffca..ca888bb9db2d 100644 --- a/cmake/public/cuda.cmake +++ b/cmake/public/cuda.cmake @@ -297,7 +297,7 @@ set_property( TARGET caffe2::nvrtc PROPERTY INTERFACE_LINK_LIBRARIES CUDA::nvrtc caffe2::cuda) -# Add onnx namepsace definition to nvcc +# Add onnx namespace definition to nvcc if(ONNX_NAMESPACE) list(APPEND CUDA_NVCC_FLAGS "-DONNX_NAMESPACE=${ONNX_NAMESPACE}") else()