bittensor icon indicating copy to clipboard operation
bittensor copied to clipboard

[Feature] [cubit] CUDA registration solver

Open camfairchild opened this issue 3 years ago • 3 comments

This PR adds a CUDA solver for the registration POW.

  • Requires: cubit
    • see requirements for cubit
  • installed as extra pip install -e .[cubit]
  • will throw error if the user doesn't have a CUDA device and/or cubit

New Flags

  • --cuda (default: False) to use CUDA registration (if available)
  • --cuda.dev_id <int> (default: 0)
  • --cuda.TPB <int, 128, 256, 512> (default: 256)
    • the number of threads per block in the CUDA kernel
      • should be left at default or raised to 512
      • may crash the registration process if too high
        • power of 2 only
  • --cuda.update_interval <int> (default: 50_000)
    • the number of nonces to solve between chain updates
      • can be raised or lowered.
        • having a higher value may mean less-frequent chain updates which may lead to trying to submit a solution outside of the valid solve window for that block (not efficient)

camfairchild avatar Aug 05 '22 01:08 camfairchild

Pull Request Test Coverage Report for Build 9887610a-0822-4309-8bb1-f5943016608e

  • 55 of 298 (18.46%) changed or added relevant lines in 4 files are covered.
  • 698 unchanged lines in 22 files lost coverage.
  • Overall coverage decreased (-16.5%) to 65.303%

Changes Missing Coverage Covered Lines Changed/Added Lines %
bittensor/_subtensor/subtensor_impl.py 1 8 12.5%
bittensor/utils/register_cuda.py 8 43 18.6%
bittensor/utils/init.py 41 242 16.94%
<!-- Total: 55 298
Files with Coverage Reduction New Missed Lines %
bittensor/_dataset/thread_queue.py 1 97.14%
bittensor/_keyfile/init.py 1 90.91%
bittensor/_metagraph/init.py 1 79.49%
bittensor/_tokenizer/init.py 1 68.29%
bittensor/_wallet/wallet_mock.py 1 72.97%
bittensor/utils/balance.py 2 66.67%
bittensor/_dataset/dataset_impl.py 4 89.44%
bittensor/_subtensor/init.py 4 78.16%
bittensor/_subtensor/subtensor_mock.py 4 85.9%
bittensor/_config/init.py 8 70.97%
<!-- Total: 698
Totals Coverage Status
Change from base Build 4e1e1b4f-b1e3-466c-8141-fd4e3f9265c2: -16.5%
Covered Lines: 3529
Relevant Lines: 5404

💛 - Coveralls

coveralls avatar Aug 05 '22 02:08 coveralls

Tested this and overall looks good! But looks like when running using btcli run it won't use cuda to register, so these flags don't quite apply there correct?

shibshib avatar Aug 12 '22 18:08 shibshib

Tested this and overall looks good! But looks like when running using btcli run it won't use cuda to register, so these flags don't quite apply there correct?

I'll have to add those flags.

camfairchild avatar Aug 12 '22 19:08 camfairchild