Skip to content

Commit

Permalink
{ai}[foss/2022a,GCCcore/11.3.0] tsne-cuda v3.0.1, faiss v1.7.2, gflag…
Browse files Browse the repository at this point in the history
…s v2.2.2, cxxopts v3.1.1 /w CUDA 11.7.0
  • Loading branch information
ThomasHoffmann77 committed Nov 8, 2023
1 parent 259a6d2 commit 2119811
Show file tree
Hide file tree
Showing 5 changed files with 290 additions and 0 deletions.
30 changes: 30 additions & 0 deletions easybuild/easyconfigs/c/cxxopts/cxxopts-3.1.1-GCCcore-11.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
##
# Author: Robert Mijakovic <[email protected]>
##
# update: thembl
easyblock = 'CMakeMake'

name = 'cxxopts'
version = '3.1.1'

homepage = 'https://github.com/jarro2783/cxxopts'
description = """cxxopts is a lightweight C++ command line option parser"""

toolchain = {'name': 'GCCcore', 'version': '11.3.0'}

github_account = 'jarro2783'
source_urls = [GITHUB_SOURCE]
sources = ['v%(version)s.tar.gz']
checksums = ['523175f792eb0ff04f9e653c90746c12655f10cb70f1d5e6d6d9491420298a08']

builddependencies = [
('CMake', '3.24.3'),
('binutils', '2.38'),
]

sanity_check_paths = {
'files': ["include/cxxopts.hpp"],
'dirs': ["lib"]
}

moduleclass = 'devel'
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Thomas Hoffmann, EMBL Heidelberg, [email protected], 2022/11
easyblock = 'CMakePythonPackage'

name = 'faiss'
version = '1.7.2'
versionsuffix = '-CUDA-%(cudaver)s'

homepage = 'https://github.com/facebookresearch/faiss'
description = """Faiss is a library for efficient similarity search and clustering of dense
vectors. It contains algorithms that search in sets of vectors of any size, up
to ones that possibly do not fit in RAM. It also contains supporting code for
evaluation and parameter tuning. Faiss is written in C++ with complete wrappers
for Python/numpy. Some of the most useful algorithms are implemented on the GPU.
It is developed primarily at Facebook AI Research."""

toolchain = {'name': 'foss', 'version': '2022a'}
toolchainopts = {'pic': True}

source_urls = [GITHUB_SOURCE]
sources = ['v%(version)s.tar.gz']
checksums = ['d49b4afd6a7a5b64f260a236ee9b2efb760edb08c33d5ea5610c2f078a5995ec']

github_account = 'facebookresearch'

builddependencies = [
('CMake', '3.23.1'),
('SWIG', '4.0.2'),
('googletest', '1.11.0'),
]
dependencies = [
('CUDA', '11.7.0', '', True),
('SciPy-bundle', '2022.05')
]

configopts = '-DFETCHCONTENT_FULLY_DISCONNECTED=ON'
configopts += ' -DFAISS_ENABLE_C_API=ON'
configopts += ' -DCMAKE_CUDA_ARCHITECTURES="%(cuda_cc_cmake)s"'
configopts += ' -DBUILD_TESTING=ON'
configopts = [
configopts + ' -DBUILD_SHARED_LIBS=ON',
configopts + ' -DBUILD_SHARED_LIBS=OFF' # order important due to libfaiss_python_callbacks.so static link.
]

build_cmd_targets = ' faiss swigfaiss'
# remove tests (all) from target preinstall:
preinstallopts = 'sed -i "s/^preinstall:.*/preinstall: faiss/g" Makefile &&'
install_cmd = 'make install && '
install_cmd += 'cd faiss/python && pip install . --prefix=%(installdir)s --ignore-installed --no-deps'
sanity_check_paths = {
'files': ['lib64/libfaiss.%s' % x for x in ['a', SHLIB_EXT]],
'dirs': ["lib", 'include']
}

moduleclass = 'lib'
35 changes: 35 additions & 0 deletions easybuild/easyconfigs/g/gflags/gflags-2.2.2-GCCcore-11.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
easyblock = 'CMakeMake'

name = 'gflags'
version = '2.2.2'

homepage = 'https://github.com/gflags/gflags'
description = """
The gflags package contains a C++ library that implements commandline flags
processing. It includes built-in support for standard types such as string
and the ability to define flags in the source file in which they are used.
"""

toolchain = {'name': 'GCCcore', 'version': '11.3.0'}
toolchainopts = {'pic': True}

source_urls = ['https://github.com/gflags/gflags/archive/']
sources = ['v%(version)s.tar.gz']
checksums = ['34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf']

builddependencies = [
('binutils', '2.38'),
('CMake', '3.24.3'),
]

configopts = '-DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON'

sanity_check_paths = {
'files': ['bin/gflags_completions.sh'] +
['lib/%s' % x for x in ['libgflags.%s' % SHLIB_EXT, 'libgflags_nothreads.%s' % SHLIB_EXT,
'libgflags.a', 'libgflags_nothreads.a']] +
['include/gflags/gflags_completions.h'],
'dirs': [],
}

moduleclass = 'devel'
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Thomas Hoffmann, EMBL Heidelberg, [email protected], 2023/11
easyblock = 'CMakePythonPackage'

name = 'tsne-cuda'
version = '3.0.1'
versionsuffix = '-CUDA-11.7.0'

homepage = 'https://github.com/CannyLab/tsne-cuda'
description = """A optimized CUDA version of FIt-SNE algorithm with associated python modules. We
find that our implementation of t-SNE can be up to 1200x faster than Sklearn, or
up to 50x faster than Multicore-TSNE when used with the right GPU. The paper
describing our approach, as well as the results below, is available at
https://arxiv.org/abs/1807.11824."""

toolchain = {'name': 'foss', 'version': '2022a'}

github_account = 'CannyLab'
source_urls = [GITHUB_SOURCE]
sources = ['%(version)s.tar.gz']
patches = ['%(name)s-%(version)s_cudacc.patch']
checksums = [
{'3.0.1.tar.gz': '0f778247191f483df22dc4dbed792c9a6a9152ee7404329c4d9da3fd9a8774d6'},
{'tsne-cuda-3.0.1_cudacc.patch': 'f9a097e871daf2951e4aa8f8a1f50bfe6ecd3f85f54f604dadf22519603aa013'},
]

builddependencies = [
('CMake', '3.24.3'),
('googletest', '1.11.0'),
('cxxopts', '3.1.1'),
('cppzmq', '4.9.0', '', SYSTEM),

]
dependencies = [
('Python', '3.10.4'),
('CUDA', '11.7.0', '', SYSTEM),
('gflags', '2.2.2'),
('ZeroMQ', '4.3.4'),
('faiss', '1.7.2', versionsuffix),
]

configopts = "-DCMAKE_CUDA_ARCHITECTURES='%(cuda_cc_cmake)s' "
configopts += '-DBUILD_PYTHON=ON '
configopts += '-DWITH_MKL=OFF '
configopts += '-DWITH_ZMQ=ON '

use_pip = True

install_cmd = 'python -m pip install python/ --prefix=%(installdir)s '

options = {'modulename': 'tsnecuda'}

sanity_check_paths = {
'files': [],
'dirs': ['lib/python%(pyshortver)s/site-packages/tsnecuda'],
}

moduleclass = 'ai'
114 changes: 114 additions & 0 deletions easybuild/easyconfigs/t/tsne-cuda/tsne-cuda-3.0.1_cudacc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Thomas Hoffmann, EMBL Heidelberg, [email protected]
# use gencodes according to CUDA_CMAKE_ARCHITECUTES
#
diff -ru tsne-cuda-3.0.1/CMakeLists.txt tsne-cuda-3.0.1_cudacc/CMakeLists.txt
--- tsne-cuda-3.0.1/CMakeLists.txt 2021-12-10 02:27:07.000000000 +0100
+++ tsne-cuda-3.0.1_cudacc/CMakeLists.txt 2023-11-07 18:53:05.060718265 +0100
@@ -58,54 +58,59 @@
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
endif()

-if(CUDAToolkit_VERSION_MAJOR EQUAL "10")
- set(CUDA_ARCH
- -gencode=arch=compute_30,code=sm_30
- -gencode=arch=compute_35,code=sm_35
- -gencode=arch=compute_37,code=sm_37
- -gencode=arch=compute_50,code=sm_50
- -gencode=arch=compute_52,code=sm_52
- -gencode=arch=compute_60,code=sm_60
- -gencode=arch=compute_61,code=sm_61
- -gencode=arch=compute_70,code=sm_70
- -gencode=arch=compute_75,code=sm_75
- )
-elseif(CUDAToolkit_VERSION_MAJOR EQUAL "11" AND CUDAToolkit_VERSION_MINOR LESS "1")
- set(CUDA_ARCH
- -gencode=arch=compute_35,code=sm_35
- -gencode=arch=compute_37,code=sm_37
- -gencode=arch=compute_50,code=sm_50
- -gencode=arch=compute_52,code=sm_52
- -gencode=arch=compute_60,code=sm_60
- -gencode=arch=compute_61,code=sm_61
- -gencode=arch=compute_70,code=sm_70
- -gencode=arch=compute_75,code=sm_75
- -gencode=arch=compute_80,code=sm_80
- )
-elseif(CUDAToolkit_VERSION_MAJOR EQUAL "11")
- set(CUDA_ARCH
- -gencode=arch=compute_35,code=sm_35
- -gencode=arch=compute_37,code=sm_37
- -gencode=arch=compute_50,code=sm_50
- -gencode=arch=compute_52,code=sm_52
- -gencode=arch=compute_60,code=sm_60
- -gencode=arch=compute_61,code=sm_61
- -gencode=arch=compute_70,code=sm_70
- -gencode=arch=compute_75,code=sm_75
- -gencode=arch=compute_80,code=sm_80
- -gencode=arch=compute_86,code=sm_86
- )
-else()
- set(CUDA_ARCH
- -gencode=arch=compute_30,code=sm_30
- -gencode=arch=compute_35,code=sm_35
- -gencode=arch=compute_37,code=sm_37
- -gencode=arch=compute_50,code=sm_50
- -gencode=arch=compute_52,code=sm_52
- -gencode=arch=compute_60,code=sm_60
- -gencode=arch=compute_61,code=sm_61
- )
-endif()
+set(CUDA_ARCH "")
+foreach(sm IN ${CUDA_CMAKE_ARCHITECUTES})
+ set(CUDA_ARCH "-gencode=arch=compute_${sm},code=sm_${sm}")
+endforeach()
+
+#if(CUDAToolkit_VERSION_MAJOR EQUAL "10")
+# set(CUDA_ARCH
+# -gencode=arch=compute_30,code=sm_30
+# -gencode=arch=compute_35,code=sm_35
+# -gencode=arch=compute_37,code=sm_37
+# -gencode=arch=compute_50,code=sm_50
+# -gencode=arch=compute_52,code=sm_52
+# -gencode=arch=compute_60,code=sm_60
+# -gencode=arch=compute_61,code=sm_61
+# -gencode=arch=compute_70,code=sm_70
+# -gencode=arch=compute_75,code=sm_75
+# )
+#elseif(CUDAToolkit_VERSION_MAJOR EQUAL "11" AND CUDAToolkit_VERSION_MINOR LESS "1")
+# set(CUDA_ARCH
+# -gencode=arch=compute_35,code=sm_35
+# -gencode=arch=compute_37,code=sm_37
+# -gencode=arch=compute_50,code=sm_50
+# -gencode=arch=compute_52,code=sm_52
+# -gencode=arch=compute_60,code=sm_60
+# -gencode=arch=compute_61,code=sm_61
+# -gencode=arch=compute_70,code=sm_70
+# -gencode=arch=compute_75,code=sm_75
+# -gencode=arch=compute_80,code=sm_80
+# )
+#elseif(CUDAToolkit_VERSION_MAJOR EQUAL "11")
+# set(CUDA_ARCH
+# -gencode=arch=compute_35,code=sm_35
+# -gencode=arch=compute_37,code=sm_37
+# -gencode=arch=compute_50,code=sm_50
+# -gencode=arch=compute_52,code=sm_52
+# -gencode=arch=compute_60,code=sm_60
+# -gencode=arch=compute_61,code=sm_61
+# -gencode=arch=compute_70,code=sm_70
+# -gencode=arch=compute_75,code=sm_75
+# -gencode=arch=compute_80,code=sm_80
+# -gencode=arch=compute_86,code=sm_86
+# )
+#else()
+# set(CUDA_ARCH
+# -gencode=arch=compute_30,code=sm_30
+# -gencode=arch=compute_35,code=sm_35
+# -gencode=arch=compute_37,code=sm_37
+# -gencode=arch=compute_50,code=sm_50
+# -gencode=arch=compute_52,code=sm_52
+# -gencode=arch=compute_60,code=sm_60
+# -gencode=arch=compute_61,code=sm_61
+# )
+#endif()


set(CUDA_OPTS

0 comments on commit 2119811

Please sign in to comment.