PyCudaHLL
This is a GPU accelerated implementation of HyperLogLog using the CuPy library. It was created for the class "Algorithmic Techniques for Taming Big Data" at the department of Computing and Data Science at Boston University.
Using the Code
To use this code, you can either get the library from PyPI or build it from source.
Get from PyPI (Recommended)
- Install using pip:
pip install pycudahll - In your code, import the library:
from pycudahll.CudaHLL import CudaHLL
Building from Source
- Clone the repository
- Install dependencies:
poetry install - In your code, import the library:
from pycudahll.CudaHLL import CudaHLL - See
test.pyfor examples. (Note:test.pyis most likely in a broken state, but should give you an idea of how to use the library.)
API
The main class of the library is CudaHLL. It can be imported in your code with:
from pycudahll.CudaHLL import CudaHLL
CudaHLL also includes a helper function to hash data to use with the main class:
from pycudahll.CudaHLL import hashDataGPUHLL
A short example of how to use the library is as follows:
from pycudahll.CudaHLL import CudaHLL, hashDataGPUHLL
with open('data.csv', 'r') as file:
data = file.read().split(',')
hashedData = hashDataGPUHLL(data)
threads = 64
p = 14
cudaDevice = 0 # optional
roundThreads = True # optional
hll = CudaHLL(p, threads, cudaDevice, roundThreads)
hll.add(hashedData)
print(hll.card()) # print unrounded cardinality estimate
print(len(hll)) # print rounded cardinality estimate
Test Data
Text of Shakespeare plays obtained from https://ocw.mit.edu/ans7870/6/6.006/s08/lecturenotes/files/t8.shakespeare.txt. Original text can be found in t8.shakespeare.txt and the modified text can be found in shakespeare.csv.
Total number of items = 899300 Exact cardinality = 34065
Metadata
Release files for pycudahll 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pycudahll-0.1.0.tar.gz | 37.5 kB | Without provenance | Details for pycudahll-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pycudahll-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pycudahll-0.1.0-py3-none-any.whl |
Total release size: 75.4 kB
Release files / pycudahll-0.1.0.tar.gz
| Download URL | pycudahll-0.1.0.tar.gz |
|---|---|
| Size | 37.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5806b9d6557a7b816f07f1750dd21d10f816c1bddefaf990cd3f5ffe0642ffd2
|
|
BLAKE2b-256 checksum How to use checksums |
0701d2f78fdd3ddd61fc9d0c111a8f6d091a1d04ebf50257c7fe783cd2653946
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.11.0 Windows/10
|
Release files / pycudahll-0.1.0-py3-none-any.whl
| Download URL | pycudahll-0.1.0-py3-none-any.whl |
|---|---|
| Size | 37.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a367b7c5ae2071907fda59f07014baf63039b541b97fdf6a9bd22a5f9d11456
|
|
BLAKE2b-256 checksum How to use checksums |
77b9522efd40eae19e4d183af618dcfc23dbf59b5dcd57a821b9d090b19d0aeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.11.0 Windows/10
|
Security for pycudahll 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.