Skip to content

Commit

Permalink
FEAT(ci): (#75) Add hybrid HIP/CUDA builds
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeSWang committed Sep 12, 2024
1 parent 35e4555 commit 7f4bbc7
Show file tree
Hide file tree
Showing 3 changed files with 684 additions and 104 deletions.
238 changes: 238 additions & 0 deletions .pyproject_hip.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
[build-system]
build-backend = 'setuptools.build_meta'
requires = [
'setuptools>=61.0',
'setuptools_scm>=6.4',
'Cython>=3.0',
'extension-helpers>=1.1',
'numpy>=2.0',
]

[project]
name = 'Triumvirate-CUDA'
description = "Three-point clustering measurements in large-scale structure analyses."
authors = [
{name = 'Mike S Wang'},
{name = 'Naonori S Sugiyama'},
]
maintainers = [
{name = 'Mike S Wang', email = "[email protected]"},
]
license = {file = "LICENCE"}
classifiers = [
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: POSIX :: Linux",
"Environment :: GPU",
"Programming Language :: C++",
"Programming Language :: Cython",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Physics",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
]
dynamic = [
'version',
'readme',
]
requires-python = '>=3.10'
dependencies = [
'numpy>=1.23',
'scipy>=1.13',
'sympy>=1.12.1',
'astropy>=4.2',
'pyyaml>=5.1',
'tqdm',
]

[project.optional-dependencies]
mpi = ['mpi4py>=3.1.5']
nbk = ['nbodykit']

[project.urls]
# Home = "https://mikeswang.github.io/Triumvirate"
Documentation = "https://triumvirate.readthedocs.io/"
Source = "https://github.com/MikeSWang/Triumvirate"
Changelog = "https://github.com/MikeSWang/Triumvirate/blob/main/CHANGELOG.md"

# [tool.setuptools]
# include-package-data = true

[tool.setuptools.dynamic]
# version = {attr = 'triumvirate.__version__'}
readme = {file = "README.rst"}

# [tool.setuptools.packages.find]
# where = ['src']
# namespaces = true

[tool.setuptools.package-data]
'triumvirate' = ["*.pxd", "*.pyx"]
'triumvirate.include' = ["*.hpp"]
'triumvirate.src' = ["*.cpp"]
'triumvirate.resources' = ["*.ini", "*.yml"]

[tool.setuptools_scm]

[tool.pytest.ini_options]
minversion = '7.0'
addopts = "--full-trace --verbose --capture=no --runslow"
testpaths = [
"tests",
]

[tool.cibuildwheel]
build-frontend = 'build'
skip = [
'cp313-*',
'pp*',
'*-win32',
'*-manylinux_i686',
'*-musllinux*',
'*_ppc64le',
'*_s390x',
]
environment = { PY_OMP='1', PY_CUDA='1', PY_BUILD_PARALLEL='-j' }
# test-requires = "pytest>=7.0"
# test-command = "pytest {project}/tests"

manylinux-x86_64-image = 'manylinux_2_28'
manylinux-aarch64-image = 'manylinux_2_28'

# TODO: Modify the following for HIP.
[tool.cibuildwheel.linux]
before-all = [
"yum install -y gsl-devel",
# Install CUDA Toolkit inside Docker container using package manager,
# matching repository with image OS, and optionally matching CUDA version
# for Pip/Conda consistency.
"yum install -y yum-utils",
"yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo",
"yum install -y cuda-toolkit",
# "yum install -y cuda-toolkit-12-6",
]
environment = { PY_CXX="/usr/local/cuda/bin/nvcc", PY_CXXFLAGS="-I/usr/local/cuda/include", PY_LDFLAGS="-L/usr/local/cuda/lib64", PY_OMP='1', PY_CUDA='1', PY_BUILD_PARALLEL='-j' }

[tool.autopep8]
in-place = true
recursive = true
aggressive = 3
max_line_length = 79
ignore = "E226,"

[tool.numpydoc_validation]
checks = [
'all',
'ES01',
'EX01',
'GL01',
'GL02',
'GL03',
'GL06',
'RT02',
'SA01',
'SS06',
]
exclude = [
'test_.*',
'\.__init__$',
'\.__repr__$',
'\.__str__$',
'\.__hash__$',
'\.__len__$',
'\.__eq__$',
'\.__le__$',
'\.__lt__$',
'\.__gt__$',
'\.__ge__$',
'\.__getitem__$',
]

# [tool.docformatter]
# recursive = true
# wrap-summaries = 72
# wrap-descriptions = 72
# blank = true
# close-quotes-on-newline = true

[tool.codespell]
skip = "publication/joss/paper.bib,"
ignore-words-list = "ERRO,"
count = true
quiet-level = 3

[tool.ruff]
target-version = 'py310'
line-length = 79
exclude = [
".eggs",
".git",
".git-rewrite",
".ipynb_checkpoints",
".nox",
".pyenv",
".pytest_cache",
".ruff_cache",
".tox",
".venv",
".vscode",
"__pypackages__",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]

[tool.ruff.lint]
fixable = ['ALL']
unfixable = []

# [tool.ruff.format]
# quote-style = 'preserve'
# indent-style = 'space'
# line-ending = 'auto'
# skip-magic-trailing-comma = true
# docstring-code-format = false
# docstring-code-line-length = 'dynamic'

[tool.semantic_release]
commit_parser = 'commit_parser:TRVCommitParser'
commit_message = "REL: Bump version to {version}"
tag_format = 'v{version}'
allow_zero_version = true
major_on_zero = false
no_git_verify = false
logging_use_named_masks = false
version_variables = [
"src/triumvirate/__init__.py:__version__",
]

[tool.semantic_release.branches.main]
match = 'main'
prerelease = false

[tool.semantic_release.changelog]
template_dir = "deploy/pkg/tmpl"
exclude_commit_patterns = ['\[dependabot\]', '\[pre-commit.ci\]',]

[tool.semantic_release.changelog.environment]
block_start_string = '{%'
block_end_string = '%}'
variable_start_string = '{{'
variable_end_string = '}}'
comment_start_string = '{#'
comment_end_string = '#}'
newline_sequence = "\n"
autoescape = true
trim_blocks = false
lstrip_blocks = false
keep_trailing_newline = false

[tool.semantic_release.commit_author]
env = 'GIT_COMMIT_AUTHOR'
default = "semantic-release <semantic-release>"
Loading

0 comments on commit 7f4bbc7

Please sign in to comment.