Skip to content

Commit

Permalink
Add Windows scripts (deepspeed, ds_report). (#5699)
Browse files Browse the repository at this point in the history
Co-authored-by: Costin Eseanu <costineseanu@gmail.com>
Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 9, 2024
1 parent 7b1ea22 commit 74f3dca
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions bin/deepspeed.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
python "%~dp0\ds" %*
2 changes: 2 additions & 0 deletions bin/ds_report.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
python "%~dp0\ds_report" %*
1 change: 1 addition & 0 deletions build_win.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@echo off

set CUDA_HOME=%CUDA_PATH%
set DISTUTILS_USE_SDK=1

set DS_BUILD_AIO=0
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/env_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def installed_cann_version():
def get_shm_size():
try:
shm_stats = os.statvfs('/dev/shm')
except (OSError, FileNotFoundError, ValueError):
except (OSError, FileNotFoundError, ValueError, AttributeError):
return "UNKNOWN", None

shm_size = shm_stats.f_frsize * shm_stats.f_blocks
Expand Down
13 changes: 9 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,14 @@ def op_enabled(op_name):
with open(os.path.join(thisdir, 'README.md'), encoding='utf-8') as fin:
readme_text = fin.read()

if sys.platform == "win32":
scripts = ['bin/deepspeed.bat', 'bin/ds', 'bin/ds_report.bat', 'bin/ds_report']
else:
scripts = [
'bin/deepspeed', 'bin/deepspeed.pt', 'bin/ds', 'bin/ds_ssh', 'bin/ds_report', 'bin/ds_bench', 'bin/dsr',
'bin/ds_elastic'
]

start_time = time.time()

setup(name='deepspeed',
Expand All @@ -303,10 +311,7 @@ def op_enabled(op_name):
extras_require=extras_require,
packages=find_packages(include=['deepspeed', 'deepspeed.*']),
include_package_data=True,
scripts=[
'bin/deepspeed', 'bin/deepspeed.pt', 'bin/ds', 'bin/ds_ssh', 'bin/ds_report', 'bin/ds_bench', 'bin/dsr',
'bin/ds_elastic'
],
scripts=scripts,
classifiers=[
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9',
Expand Down

0 comments on commit 74f3dca

Please sign in to comment.