diff options
Diffstat (limited to 'misc/py-pytorch/files')
5 files changed, 65 insertions, 22 deletions
diff --git a/misc/py-pytorch/files/patch-CMakeLists.txt b/misc/py-pytorch/files/patch-CMakeLists.txt index 2a92cee61cdc..f7b4af5cd8d0 100644 --- a/misc/py-pytorch/files/patch-CMakeLists.txt +++ b/misc/py-pytorch/files/patch-CMakeLists.txt @@ -1,6 +1,6 @@ ---- CMakeLists.txt.orig 2025-04-23 16:19:35 UTC +--- CMakeLists.txt.orig 2025-08-06 17:08:00 UTC +++ CMakeLists.txt -@@ -182,7 +182,7 @@ set(CPU_POWER OFF) +@@ -173,7 +173,7 @@ set(CPU_POWER OFF) set(CPU_INTEL OFF) set(CPU_POWER OFF) @@ -9,7 +9,7 @@ set(CPU_INTEL ON) elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)") set(CPU_AARCH64 ON) -@@ -212,7 +212,7 @@ option(BUILD_CUSTOM_PROTOBUF +@@ -203,7 +203,7 @@ option(BUILD_CUSTOM_PROTOBUF option(ATEN_NO_TEST "Do not build ATen test binaries" OFF) option(BUILD_BINARY "Build C++ binaries" OFF) option(BUILD_CUSTOM_PROTOBUF @@ -18,7 +18,7 @@ option(BUILD_PYTHON "Build Python binaries" ON) option(BUILD_LITE_INTERPRETER "Master flag to build Lite Interpreter" OFF) option(BUILD_SHARED_LIBS "Build libcaffe2.so" ON) -@@ -263,7 +263,7 @@ option(USE_GLOG "Use GLOG" OFF) +@@ -254,7 +254,7 @@ option(USE_GLOG "Use GLOG" OFF) option(USE_FAKELOWP "Use FakeLowp operators" OFF) option(USE_GFLAGS "Use GFLAGS" OFF) option(USE_GLOG "Use GLOG" OFF) @@ -27,7 +27,7 @@ option(USE_MAGMA "Use MAGMA" ON) option(USE_PYTORCH_METAL "Use Metal for PyTorch iOS build" OFF) option(USE_PYTORCH_METAL_EXPORT "Export Metal models on MacOSX desktop" OFF) -@@ -453,15 +453,15 @@ option(USE_SYSTEM_CPUINFO "Use system-provided cpuinfo +@@ -451,15 +451,15 @@ option(USE_SYSTEM_CPUINFO "Use system-provided cpuinfo # USE_SYSTEM_LIBS being "OFF". option(USE_SYSTEM_LIBS "Use all available system-provided libraries." OFF) option(USE_SYSTEM_CPUINFO "Use system-provided cpuinfo." OFF) diff --git a/misc/py-pytorch/files/patch-third__party_fbgemm_third__party_asmjit_src_asmjit_core_virtmem.cpp b/misc/py-pytorch/files/patch-third__party_fbgemm_third__party_asmjit_src_asmjit_core_virtmem.cpp deleted file mode 100644 index 09a801db1dfc..000000000000 --- a/misc/py-pytorch/files/patch-third__party_fbgemm_third__party_asmjit_src_asmjit_core_virtmem.cpp +++ /dev/null @@ -1,10 +0,0 @@ ---- third_party/fbgemm/third_party/asmjit/src/asmjit/core/virtmem.cpp.orig 2022-12-16 00:23:48 UTC -+++ third_party/fbgemm/third_party/asmjit/src/asmjit/core/virtmem.cpp -@@ -45,6 +45,7 @@ - #endif - - #include <atomic> -+#include <sys/stat.h> - - #if defined(__APPLE__) || defined(__BIONIC__) - #define ASMJIT_VM_SHM_DETECT 0 diff --git a/misc/py-pytorch/files/patch-third__party_tensorpipe_tensorpipe_common_system.cc b/misc/py-pytorch/files/patch-third__party_tensorpipe_tensorpipe_common_system.cc new file mode 100644 index 000000000000..cc052f650cfa --- /dev/null +++ b/misc/py-pytorch/files/patch-third__party_tensorpipe_tensorpipe_common_system.cc @@ -0,0 +1,30 @@ +--- third_party/tensorpipe/tensorpipe/common/system.cc.orig 2025-06-04 18:15:56 UTC ++++ third_party/tensorpipe/tensorpipe/common/system.cc +@@ -102,6 +102,27 @@ std::string getPathForLinuxNamespace(LinuxNamespace ns + return oss.str(); + } + ++#elif defined(__FreeBSD__) ++ ++#include <unistd.h> ++#include <stdio.h> ++#include <sys/sysctl.h> ++#include <time.h> ++ ++optional<std::string> getBootIDInternal() { ++ char hostname[256]; ++ (void)::gethostname(hostname, sizeof(hostname)); ++ ++ struct timeval boottime; ++ size_t size = sizeof(boottime); ++ (void)sysctlbyname("kern.boottime", &boottime, &size, nullptr, 0); ++ ++ char buf[512]; ++ ::sprintf(buf, "%s-%ld-%ld", hostname, boottime.tv_sec, boottime.tv_usec); ++ ++ return std::string(buf); ++} ++ + #endif + + } // namespace diff --git a/misc/py-pytorch/files/patch-tools_build__pytorch__libs.py b/misc/py-pytorch/files/patch-tools_build__pytorch__libs.py index 2ab33dd899a4..7a421c1bd8e3 100644 --- a/misc/py-pytorch/files/patch-tools_build__pytorch__libs.py +++ b/misc/py-pytorch/files/patch-tools_build__pytorch__libs.py @@ -1,11 +1,12 @@ ---- tools/build_pytorch_libs.py.orig 2025-04-24 16:28:33 UTC +--- tools/build_pytorch_libs.py.orig 2025-08-06 17:08:06 UTC +++ tools/build_pytorch_libs.py -@@ -119,7 +119,7 @@ def build_pytorch( - cmake: CMake, - ) -> None: - my_env = _create_build_env() -- checkout_nccl() -+ #checkout_nccl() +@@ -91,7 +91,8 @@ def build_pytorch( + and not check_negative_env_flag("USE_NCCL") + and not check_env_flag("USE_SYSTEM_NCCL") + ): +- checkout_nccl() ++ #checkout_nccl() ++ pass build_test = not check_negative_env_flag("BUILD_TEST") cmake.generate( version, cmake_python_library, build_python, build_test, my_env, rerun_cmake diff --git a/misc/py-pytorch/files/patch-torch_csrc_distributed_c10d_ProcessGroupGloo.cpp b/misc/py-pytorch/files/patch-torch_csrc_distributed_c10d_ProcessGroupGloo.cpp new file mode 100644 index 000000000000..7977852226dd --- /dev/null +++ b/misc/py-pytorch/files/patch-torch_csrc_distributed_c10d_ProcessGroupGloo.cpp @@ -0,0 +1,22 @@ +--- torch/csrc/distributed/c10d/ProcessGroupGloo.cpp.orig 2025-06-04 18:15:57 UTC ++++ torch/csrc/distributed/c10d/ProcessGroupGloo.cpp +@@ -111,6 +111,10 @@ + } + #endif + ++#if defined(__FreeBSD__) ++#define HOST_NAME_MAX 256 ++#endif ++ + namespace c10d { + + namespace { +@@ -705,7 +709,7 @@ std::shared_ptr<::gloo::transport::Device> ProcessGrou + return ::c10d::GlooDeviceFactory::makeDeviceForHostname(hostname); + } + +-#if defined(__linux__) || defined(_WIN32) ++#if defined(__linux__) || defined(__FreeBSD__) || defined(_WIN32) + std::shared_ptr<::gloo::transport::Device> ProcessGroupGloo:: + createDefaultDevice() { + // Use the hostname to resolve the network address to |