Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.2.2 #15

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@ A python package to register on the bittensor network using a CUDA device.
Using the wheel for your version of python (3.8, etc.) from [releases](https://github.com/opentensor/cubit/releases/latest)
For Python 3.8
```
pip install https://github.com/opentensor/cubit/releases/download/v1.1.2/cubit-1.1.2-cp38-cp38-linux_x86_64.whl
pip install https://github.com/opentensor/cubit/releases/download/v1.2.2/cubit-1.2.2-cp38-cp38-linux_x86_64.whl
```
For Python 3.9
```
pip install https://github.com/opentensor/cubit/releases/download/v1.1.2/cubit-1.1.2-cp39-cp39-linux_x86_64.whl
pip install https://github.com/opentensor/cubit/releases/download/v1.2.2/cubit-1.2.2-cp39-cp39-linux_x86_64.whl
```
For Python 3.9
```
pip install https://github.com/opentensor/cubit/releases/download/v1.1.2/cubit-1.1.2-cp310-cp310-linux_x86_64.whl
pip install https://github.com/opentensor/cubit/releases/download/v1.2.2/cubit-1.2.2-cp310-cp310-linux_x86_64.whl
```
#### Install testing dependencies
Install `test` extras from wheel
For Python 3.8
```
pip install https://github.com/opentensor/cubit/releases/download/v1.1.2/cubit-1.1.2-cp38-cp38-linux_x86_64.whl[test]
pip install https://github.com/opentensor/cubit/releases/download/v1.2.2/cubit-1.2.2-cp38-cp38-linux_x86_64.whl[test]
```
For Python 3.9
```
pip install https://github.com/opentensor/cubit/releases/download/v1.1.2/cubit-1.1.2-cp39-cp39-linux_x86_64.whl[test]
pip install https://github.com/opentensor/cubit/releases/download/v1.2.2/cubit-1.2.2-cp39-cp39-linux_x86_64.whl[test]
```
For Python 3.10
```
pip install https://github.com/opentensor/cubit/releases/download/v1.1.2/cubit-1.1.2-cp310-cp310-linux_x86_64.whl[test]
pip install https://github.com/opentensor/cubit/releases/download/v1.2.2/cubit-1.2.2-cp310-cp310-linux_x86_64.whl[test]
```
### From source
#### Requirements
Expand Down Expand Up @@ -86,3 +86,4 @@ python3 -m unittest test.py
https://github.com/rmcgibbo/npcuda-example/
https://github.com/mochimodev/cuda-hashing-algos/
https://github.com/camfairchild/bittensor_register_cuda/
https://github.com/GithubRealFan/cubit-fast/
23 changes: 13 additions & 10 deletions kernels/main.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* The MIT License (MIT)
* Copyright (c) 2023 GithubRealFan
* Copyright (c) 2022 Cameron Fairchild
* Copyright (c) 2022 Opentensor Foundation

Expand Down Expand Up @@ -145,10 +146,13 @@ __device__ void create_seal_hash(BYTE* seal, BYTE* block_hash, uint64 nonce) {
__device__ bool found = false;

// TODO: Use CUDA streams and events to dispatch new blocks and recieve solutions
__global__ void solve(uint64* solution, uint64 nonce_start, uint64 update_interval, unsigned int n_nonces, uint256 limit, BYTE* block_bytes) {
for (uint64 i = blockIdx.x * blockDim.x + threadIdx.x;
i < n_nonces;
i += blockDim.x * gridDim.x)
__global__ void solve(uint64* solution, uint64 nonce_start, uint64 update_interval, unsigned int n_nonces, uint256 limit, BYTE* block_bytes)
{
int blockSize = 8;
uint64 new_interval = update_interval / blockSize;
for (uint64 i = blockIdx.x * blockDim.x + threadIdx.x;
i < n_nonces * blockSize;
i += blockDim.x * gridDim.x)
{
if (found) {
break;
Expand All @@ -160,8 +164,8 @@ __global__ void solve(uint64* solution, uint64 nonce_start, uint64 update_interv
seal[j] = 0xff;
}

uint64 nonce = nonce_start + i * update_interval;
for (uint64 j = nonce; j < nonce + update_interval; j++) {
uint64 nonce = nonce_start + i * new_interval;
for (uint64 j = nonce; j < nonce + new_interval; j++) {
create_seal_hash(seal, block_bytes, j);

if (seal_meets_difficulty(seal, limit)) {
Expand Down Expand Up @@ -212,10 +216,9 @@ __global__ void test_seal_meets_difficulty(BYTE* seal, uint256 limit, bool* resu
*result = seal_meets_difficulty(seal, limit);
}

void runSolve(int blockSize, uint64* solution, uint64 nonce_start, uint64 update_interval, uint256 limit, BYTE* block_bytes) {
int numBlocks = (blockSize + blockSize - 1) / blockSize;

solve <<< numBlocks, blockSize >>> (solution, nonce_start, update_interval, blockSize, limit, block_bytes);
void runSolve(int blockSize, uint64 *solution, uint64 nonce_start, uint64 update_interval, uint256 limit, BYTE *block_bytes)
{
solve<<<8, blockSize>>>(solution, nonce_start, update_interval, blockSize, limit, block_bytes);
}

bool runTestSealMeetsDifficulty(BYTE* seal, uint256 limit) {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "cubit"
version = "1.2.0"
version = "1.2.2"
description = "A python package for CUDA registration on bittensor. "
readme = "README.md"
authors = [{ name = "Opentensor Foundation", email = "[email protected]" }]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def build_extensions(self):
author = 'Opentensor Foundation',
author_email = '[email protected]',
url = 'https://github.com/opentensor/cubit',
version = '1.2.1',
version = '1.2.2',

ext_modules = cythonize(ext),

Expand Down