-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b1f5f5
commit 32fdf80
Showing
3 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
easyblock = 'CMakeMake' | ||
|
||
name = 'CTranslate2' | ||
version = '4.3.1' | ||
versionsuffix = '-CUDA-%(cudaver)s' | ||
|
||
homepage = 'https://opennmt.net/CTranslate2/' | ||
description = "Fast inference engine for Transformer models." | ||
|
||
toolchain = {'name': 'foss', 'version': '2023a'} | ||
toolchainopts = {'optarch': False} | ||
|
||
source_urls = ['https://github.com/OpenNMT/CTranslate2/archive/'] | ||
sources = [{ | ||
"download_filename": "v%(version)s.tar.gz", | ||
"filename": SOURCE_TAR_GZ, | ||
}] | ||
patches = [ | ||
'CTranslate2-4.5.0_fix-third-party.patch', | ||
'CTranslate2-4.5.0_fix-tests.patch', | ||
'CTranslate2-4.5.0_replace-cxxopts.patch', | ||
] | ||
checksums = [ | ||
{'CTranslate2-4.3.1.tar.gz': 'e392e9c43d2602fae8dd173b447e5b8a766c4a63cff7b3af9bbcc9aeafea3a5f'}, | ||
{'CTranslate2-4.5.0_fix-third-party.patch': '07a6e2842e7261901460e0e1e705db645be366008be184db23778668a3bf8de2'}, | ||
{'CTranslate2-4.5.0_fix-tests.patch': '73123eafe612538354be5aa96c750199e1a219a5316800848c3894c1cc6ca2ad'}, | ||
{'CTranslate2-4.5.0_replace-cxxopts.patch': 'e378969c2968e2fd57863956a4d2f267731a49d1b890dcc45593d6a310531271'}, | ||
] | ||
|
||
builddependencies = [ | ||
('CMake', '3.26.3'), | ||
('pybind11', '2.11.1'), | ||
('cxxopts', '3.0.0', '', SYSTEM), | ||
('spdlog', '1.11.0'), | ||
('cpu_features', '0.9.0'), | ||
] | ||
|
||
dependencies = [ | ||
('CUDA', '12.1.1', '', SYSTEM), | ||
('Python', '3.11.3'), | ||
('SciPy-bundle', '2023.07'), | ||
('CUTLASS', '3.4.0', versionsuffix), | ||
('googletest', '1.13.0'), | ||
('PyYAML', '6.0'), | ||
('cuDNN', '8.9.2.26', versionsuffix, SYSTEM), | ||
] | ||
|
||
# make sure that CTranslate2 libraries are linked to FlexiBLAS, not OpenBLAS | ||
preconfigopts = "export CMAKE_INCLUDE_PATH=$EBROOTFLEXIBLAS/include/flexiblas:${CMAKE_INCLUDE_PATH} && " | ||
preconfigopts += "sed -i 's/openblas/flexiblas/g' %(start_dir)s/CMakeLists.txt && " | ||
|
||
configopts = '-DOPENMP_RUNTIME=COMP -DWITH_CUDA=ON -DWITH_MKL=OFF ' | ||
configopts += '-DOPENBLAS_INCLUDE_DIR="$EBROOTFLEXIBLAS/include" -DWITH_OPENBLAS=ON ' | ||
configopts += '-DCUTLASS_INCLUDE_DIRS="$EBROOTCUTLASS/include" ' | ||
configopts += '-DWITH_CUDNN=ON ' | ||
configopts += '-DENABLE_CPU_DISPATCH=OFF ' | ||
|
||
prebuildopts = 'export CT2_VERBOSE=3 && ' | ||
|
||
exts_defaultclass = 'PythonPackage' | ||
exts_default_options = { | ||
'source_urls': [PYPI_SOURCE], | ||
'download_dep_fail': True, | ||
'use_pip': True, | ||
'sanity_pip_check': True, | ||
'installopts': '', | ||
'runtest': False, | ||
} | ||
|
||
exts_list = [ | ||
('ctranslate2', version, { | ||
'sources': ['CTranslate2-%(version)s.tar.gz'], | ||
'start_dir': 'python', | ||
'checksums': ['e392e9c43d2602fae8dd173b447e5b8a766c4a63cff7b3af9bbcc9aeafea3a5f'], | ||
}), | ||
] | ||
|
||
sanity_check_paths = { | ||
'files': ['bin/ct2-translator', 'lib/libctranslate2.%s' % SHLIB_EXT], | ||
'dirs': ['include/ctranslate2', 'lib/python%(pyshortver)s/site-packages'], | ||
} | ||
|
||
sanity_check_commands = [ | ||
"ct2-translator --help", | ||
"python -c 'import ctranslate2'", | ||
"python -m pip check", | ||
] | ||
|
||
modextrapaths = {'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages'} | ||
|
||
moduleclass = 'ai' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
easyblock = 'CMakeMake' | ||
|
||
name = 'CTranslate2' | ||
version = '4.4.0' | ||
versionsuffix = '-CUDA-%(cudaver)s' | ||
|
||
homepage = 'https://opennmt.net/CTranslate2/' | ||
description = "Fast inference engine for Transformer models." | ||
|
||
toolchain = {'name': 'foss', 'version': '2023a'} | ||
toolchainopts = {'optarch': False} | ||
|
||
source_urls = ['https://github.com/OpenNMT/CTranslate2/archive/'] | ||
sources = [{ | ||
"download_filename": "v%(version)s.tar.gz", | ||
"filename": SOURCE_TAR_GZ, | ||
}] | ||
patches = [ | ||
'CTranslate2-4.5.0_fix-third-party.patch', | ||
'CTranslate2-4.5.0_fix-tests.patch', | ||
'CTranslate2-4.5.0_replace-cxxopts.patch', | ||
] | ||
checksums = [ | ||
{'CTranslate2-4.4.0.tar.gz': '2896451f2485fdc3587c0fda1468f836bd2bdcbd156f2a8d9580515d9fd23253'}, | ||
{'CTranslate2-4.5.0_fix-third-party.patch': '07a6e2842e7261901460e0e1e705db645be366008be184db23778668a3bf8de2'}, | ||
{'CTranslate2-4.5.0_fix-tests.patch': '73123eafe612538354be5aa96c750199e1a219a5316800848c3894c1cc6ca2ad'}, | ||
{'CTranslate2-4.5.0_replace-cxxopts.patch': 'e378969c2968e2fd57863956a4d2f267731a49d1b890dcc45593d6a310531271'}, | ||
] | ||
|
||
builddependencies = [ | ||
('CMake', '3.26.3'), | ||
('pybind11', '2.11.1'), | ||
('cxxopts', '3.0.0', '', SYSTEM), | ||
('spdlog', '1.11.0'), | ||
('cpu_features', '0.9.0'), | ||
] | ||
|
||
dependencies = [ | ||
('CUDA', '12.1.1', '', SYSTEM), | ||
('Python', '3.11.3'), | ||
('SciPy-bundle', '2023.07'), | ||
('CUTLASS', '3.4.0', versionsuffix), | ||
('googletest', '1.13.0'), | ||
('PyYAML', '6.0'), | ||
('cuDNN', '8.9.2.26', versionsuffix, SYSTEM), | ||
] | ||
|
||
# make sure that CTranslate2 libraries are linked to FlexiBLAS, not OpenBLAS | ||
preconfigopts = "export CMAKE_INCLUDE_PATH=$EBROOTFLEXIBLAS/include/flexiblas:${CMAKE_INCLUDE_PATH} && " | ||
preconfigopts += "sed -i 's/openblas/flexiblas/g' %(start_dir)s/CMakeLists.txt && " | ||
|
||
configopts = '-DOPENMP_RUNTIME=COMP -DWITH_CUDA=ON -DWITH_MKL=OFF ' | ||
configopts += '-DOPENBLAS_INCLUDE_DIR="$EBROOTFLEXIBLAS/include" -DWITH_OPENBLAS=ON ' | ||
configopts += '-DCUTLASS_INCLUDE_DIRS="$EBROOTCUTLASS/include" ' | ||
# configopts += '-DBUILD_TESTS=ON ' | ||
configopts += '-DWITH_CUDNN=ON ' | ||
configopts += '-DENABLE_CPU_DISPATCH=OFF ' | ||
configopts += '-DCT2_CUDA_ALLOW_BF16=0 ' | ||
configopts += '-DCT2_WITH_BFLOAT16=OFF ' | ||
|
||
prebuildopts = 'export CT2_VERBOSE=3 && export CT2_CUDA_ALLOW_BF16=0 && ' | ||
|
||
exts_defaultclass = 'PythonPackage' | ||
exts_default_options = { | ||
'source_urls': [PYPI_SOURCE], | ||
'download_dep_fail': True, | ||
'use_pip': True, | ||
'sanity_pip_check': True, | ||
'installopts': '', | ||
'runtest': False, | ||
} | ||
|
||
exts_list = [ | ||
('ctranslate2', version, { | ||
'sources': ['CTranslate2-%(version)s.tar.gz'], | ||
'start_dir': 'python', | ||
'checksums': ['2896451f2485fdc3587c0fda1468f836bd2bdcbd156f2a8d9580515d9fd23253'], | ||
}), | ||
] | ||
|
||
sanity_check_paths = { | ||
'files': ['bin/ct2-translator', 'lib/libctranslate2.%s' % SHLIB_EXT], | ||
'dirs': ['include/ctranslate2', 'lib/python%(pyshortver)s/site-packages'], | ||
} | ||
|
||
sanity_check_commands = [ | ||
"ct2-translator --help", | ||
"python -c 'import ctranslate2'", | ||
"python -m pip check", | ||
] | ||
|
||
modextrapaths = {'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages'} | ||
|
||
moduleclass = 'ai' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters