-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- python interface changes - add `from_fasta_to_lower_triangular` - this constructs lower triangular matrix file directly from fasta file - for now only works on GPU - faster & requires less RAM than doing `from_fasta` followed by `dump_lower_triangular` - add `use_gpu` option to `from_fasta` - if True and include_x is False then the GPU is used to calcuate distances matrix - CUDA implementation - each block of threads calculates a single element of the distances matrix - a kernel is launched running on a grid of these blocks to calculate a subset of the distances matrix - I/O is interleaved with computation: the CPU writes the previous kernel results as the next kernel is running - Build wheels with manylinux2014 with CUDA installed from https://github.com/ameli/manylinux-cuda TODO: - add scaling plot to PR - add logic to check for GPU, fail gracefully if not found - add error handling if CUDA kernel launch fails - ensure wheel built with CUDA still runs as before on CPU both with & without a gpu - see https://github.com/OpenNMT/CTranslate2/blob/master/.github/workflows/ci.yml for example of building wheels with cuda, they install cuda into the manylinux container
- Loading branch information
Showing
33 changed files
with
1,084 additions
and
247 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
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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
name: Build Wheels + PyPI deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
push | ||
# : | ||
# branches: | ||
# - main | ||
# pull_request: | ||
# workflow_dispatch: | ||
# release: | ||
# types: [published] | ||
|
||
concurrency: | ||
group: wheels-${{ github.ref }} | ||
|
@@ -28,9 +29,13 @@ jobs: | |
submodules: "recursive" | ||
|
||
- uses: pypa/[email protected] | ||
env: | ||
CIBW_MANYLINUX_X86_64_IMAGE: sameli/manylinux2014_x86_64_cuda_12.3 | ||
CIBW_BEFORE_ALL_LINUX: ci/manylinux_setup.sh | ||
|
||
- uses: actions/upload-artifact@v3 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifacts-${{ matrix.os }} | ||
path: ./wheelhouse/*.whl | ||
|
||
upload_pypi: | ||
|
@@ -41,9 +46,10 @@ jobs: | |
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
pattern: artifacts-* | ||
merge-multiple: true | ||
path: dist | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 |
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
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
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,18 @@ | ||
#! /bin/bash | ||
|
||
set -e -x | ||
|
||
# yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo | ||
|
||
# yum install --setopt=obsoletes=0 -y \ | ||
# cuda-nvcc-11-2-11.2.152-1 \ | ||
# cuda-cudart-devel-11-2-11.2.152-1 \ | ||
# libcurand-devel-11-2-10.2.3.152-1 \ | ||
# libcudnn8-devel-8.1.1.33-1.cuda11.2 \ | ||
# libcublas-devel-11-2-11.4.1.1043-1 | ||
|
||
# ln -s cuda-11.2 /usr/local/cuda | ||
|
||
nvcc --version | ||
|
||
which nvcc |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
add_subdirectory(fmt) | ||
|
||
if(HAMMING_BUILD_PYTHON) | ||
add_subdirectory(pybind11) | ||
endif() | ||
|
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
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
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,25 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
#include <iostream> | ||
#include <vector> | ||
|
||
#include "hamming/hamming_impl_types.hh" | ||
|
||
namespace hamming { | ||
|
||
int distance_cuda(const std::vector<GeneBlock> &a, | ||
const std::vector<GeneBlock> &b); | ||
|
||
// for now explicit function def for each choice of integer type | ||
std::vector<uint8_t> | ||
distances_cuda_8bit(const std::vector<std::vector<GeneBlock>> &data); | ||
|
||
std::vector<uint16_t> | ||
distances_cuda_16bit(const std::vector<std::vector<GeneBlock>> &data); | ||
|
||
void distances_cuda_to_lower_triangular( | ||
const std::vector<std::vector<GeneBlock>> &data, | ||
const std::string &filename); | ||
|
||
} // namespace hamming |
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
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
Oops, something went wrong.