From a2b08a6e0fd5629eada142e549b69b4581f77f5b Mon Sep 17 00:00:00 2001 From: Costin Eseanu Date: Fri, 31 May 2024 20:16:12 +0000 Subject: [PATCH 1/2] Fixed the Windows build. --- build_win.bat | 15 ++++----------- csrc/includes/simd.h | 1 + csrc/quantization/pt_binding.cpp | 2 +- setup.py | 17 ++++------------- 4 files changed, 10 insertions(+), 25 deletions(-) diff --git a/build_win.bat b/build_win.bat index af5c5103fa4b..18ff17347fc9 100644 --- a/build_win.bat +++ b/build_win.bat @@ -1,22 +1,15 @@ @echo off +set DISTUTILS_USE_SDK=1 + set DS_BUILD_AIO=0 set DS_BUILD_CUTLASS_OPS=0 set DS_BUILD_EVOFORMER_ATTN=0 set DS_BUILD_FP_QUANTIZER=0 +set DS_BUILD_INFERENCE_CORE_OPS=0 set DS_BUILD_RAGGED_DEVICE_OPS=0 set DS_BUILD_SPARSE_ATTN=0 - -echo Administrative permissions required. Detecting permissions... - -net session >nul 2>&1 -if %errorLevel% == 0 ( - echo Success: Administrative permissions confirmed. -) else ( - echo Failure: Current permissions inadequate. - goto end -) - +set DS_BUILD_TRANSFORMER_INFERENCE=0 python setup.py bdist_wheel diff --git a/csrc/includes/simd.h b/csrc/includes/simd.h index 73e41216a652..f5bfb45dd2e2 100644 --- a/csrc/includes/simd.h +++ b/csrc/includes/simd.h @@ -12,6 +12,7 @@ #define TILE (128 * 1024 * 1024) #if defined(__AVX512__) or defined(__AVX256__) +#include template inline T readAs(const void* src) diff --git a/csrc/quantization/pt_binding.cpp b/csrc/quantization/pt_binding.cpp index a4210897092d..e74c541699d7 100644 --- a/csrc/quantization/pt_binding.cpp +++ b/csrc/quantization/pt_binding.cpp @@ -241,7 +241,7 @@ std::vector quantized_reduction(at::Tensor& input_vals, .device(at::kCUDA) .requires_grad(false); - std::vector sz(input_vals.sizes().begin(), input_vals.sizes().end()); + std::vector sz(input_vals.sizes().begin(), input_vals.sizes().end()); sz[sz.size() - 1] = sz.back() / devices_per_node; // num of GPU per nodes const int elems_per_in_tensor = at::numel(input_vals) / devices_per_node; auto output = torch::empty(sz, output_options); diff --git a/setup.py b/setup.py index 839941b989c9..55e4a5728f93 100755 --- a/setup.py +++ b/setup.py @@ -19,6 +19,7 @@ """ import os +import shutil import sys import subprocess from setuptools import setup, find_packages @@ -208,20 +209,10 @@ def op_enabled(op_name): git_branch = "unknown" -def create_dir_symlink(src, dest): - if not os.path.islink(dest): - if os.path.exists(dest): - os.remove(dest) - assert not os.path.exists(dest) - os.symlink(src, dest) - - if sys.platform == "win32": - # This creates a symbolic links on Windows. - # It needs Administrator privilege to create symlinks on Windows. - create_dir_symlink('.\\deepspeed\\ops\\csrc', '..\\..\\csrc') - create_dir_symlink('.\\deepspeed\\ops\\op_builder', '..\\..\\op_builder') - create_dir_symlink('.\\deepspeed\\accelerator', '..\\accelerator') + shutil.copytree('.\\csrc', '.\\deepspeed\\ops') + shutil.copytree('.\\op_builder', '.\\deepspeed\\ops') + shutil.copytree('.\\accelerator', '.\\deepspeed\\accelerator') egg_info.manifest_maker.template = 'MANIFEST_win.in' # Parse the DeepSpeed version string from version.txt. From fe52abe8e16dfbbac0ab1f8c405dba307bec28a8 Mon Sep 17 00:00:00 2001 From: Costin Eseanu Date: Fri, 31 May 2024 20:28:13 +0000 Subject: [PATCH 2/2] Fixed whitespace. --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 55e4a5728f93..408b300a78b0 100755 --- a/setup.py +++ b/setup.py @@ -208,7 +208,6 @@ def op_enabled(op_name): git_hash = "unknown" git_branch = "unknown" - if sys.platform == "win32": shutil.copytree('.\\csrc', '.\\deepspeed\\ops') shutil.copytree('.\\op_builder', '.\\deepspeed\\ops')