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

Add openai miner #5

Merged
merged 9 commits into from
Sep 12, 2023
Merged
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
149 changes: 0 additions & 149 deletions miners/miner.py

This file was deleted.

123 changes: 123 additions & 0 deletions neurons/bittensorLM/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
## Bittensor LM (BTLM) Miner
Bittensor LM Language Model
This code is for running the very small (3B) Bittensor Language Model created by btlm.

# Install
```
python3 -m pip install -r openminers/text_to_text/bittensor_lm/requirements.txt
```

# Example Usage
```
python3 openminers/text_to_text/bittensor_lm/miner.py
```

# Full Usage
```
usage: miner.py [-h] [--btlm.device btlm.DEVICE] [--btlm.max_length btlm.MAX_LENGTH] [--btlm.do_sample]
[--btlm.no_repeat_ngram_size btlm.NO_REPEAT_NGRAM_SIZE] [--btlm.use_deepspeed]
[--btlm.do_prompt_injection] [--btlm.system_prompt SYSTEM_PROMPT] [--btlm.use_vanilla_process_history]
[--netuid NETUID] [--neuron.name NEURON.NAME] [--neuron.blocks_per_epoch NEURON.BLOCKS_PER_EPOCH] [--neuron.no_set_weights]
[--neuron.max_batch_size NEURON.MAX_BATCH_SIZE] [--neuron.max_sequence_len NEURON.MAX_SEQUENCE_LEN]
[--neuron.blacklist.hotkeys [NEURON.BLACKLIST.HOTKEYS ...]] [--neuron.blacklist.allow_non_registered]
[--neuron.blacklist.default_stake NEURON.BLACKLIST.DEFAULT_STAKE] [--neuron.default_priority NEURON.DEFAULT_PRIORITY]
[--wallet.name WALLET.NAME] [--wallet.hotkey WALLET.HOTKEY] [--wallet.path WALLET.PATH] [--wallet._mock]
[--wallet.reregister WALLET.REREGISTER] [--axon.priority.max_workers AXON.PRIORITY.MAX_WORKERS]
[--axon.priority.maxsize AXON.PRIORITY.MAXSIZE] [--axon.port AXON.PORT] [--axon.ip AXON.IP]
[--axon.external_port AXON.EXTERNAL_PORT] [--axon.external_ip AXON.EXTERNAL_IP] [--axon.max_workers AXON.MAX_WORKERS]
[--axon.maximum_concurrent_rpcs AXON.MAXIMUM_CONCURRENT_RPCS] [--subtensor.network SUBTENSOR.NETWORK]
[--subtensor.chain_endpoint SUBTENSOR.CHAIN_ENDPOINT] [--subtensor._mock]
[--subtensor.register.num_processes SUBTENSOR.REGISTER.NUM_PROCESSES]
[--subtensor.register.update_interval SUBTENSOR.REGISTER.UPDATE_INTERVAL] [--subtensor.register.no_output_in_place]
[--subtensor.register.verbose] [--subtensor.register.cuda.use_cuda] [--subtensor.register.cuda.no_cuda]
[--subtensor.register.cuda.dev_id SUBTENSOR.REGISTER.CUDA.DEV_ID [SUBTENSOR.REGISTER.CUDA.DEV_ID ...]]
[--subtensor.register.cuda.TPB SUBTENSOR.REGISTER.CUDA.TPB] [--logging.debug] [--logging.trace] [--logging.record_log]
[--logging.logging_dir LOGGING.LOGGING_DIR] [--metagraph._mock] [--config CONFIG] [--strict]

optional arguments:
-h, --help show this help message and exit
--btlm.device btlm.DEVICE
Device to load model
--btlm.max_length btlm.MAX_LENGTH
The maximum length (in tokens) of the generated text.
--btlm.do_sample Whether to use sampling or not (if not, uses greedy decoding).
--btlm.no_repeat_ngram_size btlm.NO_REPEAT_NGRAM_SIZE
The size of the n-grams to avoid repeating in the generated text.
--btlm.model_size {1.3B,2.7B,6.7B,13B}
Model size to use.
--netuid NETUID Subnet netuid
--neuron.name NEURON.NAME
Trials for this miner go in miner.root / (wallet_cold - wallet_hot) / miner.name
--neuron.blocks_per_epoch NEURON.BLOCKS_PER_EPOCH
Blocks until the miner sets weights on chain
--neuron.no_set_weights
If True, the model does not set weights.
--neuron.max_batch_size NEURON.MAX_BATCH_SIZE
The maximum batch size for forward requests.
--neuron.max_sequence_len NEURON.MAX_SEQUENCE_LEN
The maximum sequence length for forward requests.
--neuron.blacklist.hotkeys [NEURON.BLACKLIST.HOTKEYS ...]
To blacklist certain hotkeys
--neuron.blacklist.allow_non_registered
If True, the miner will allow non-registered hotkeys to mine.
--neuron.blacklist.default_stake NEURON.BLACKLIST.DEFAULT_STAKE
Set default stake for miners.
--neuron.default_priority NEURON.DEFAULT_PRIORITY
Set default priority for miners.
--wallet.name WALLET.NAME
The name of the wallet to unlock for running bittensor (name mock is reserved for mocking this wallet)
--wallet.hotkey WALLET.HOTKEY
The name of wallet's hotkey.
--wallet.path WALLET.PATH
The path to your bittensor wallets
--wallet._mock To turn on wallet mocking for testing purposes.
--wallet.reregister WALLET.REREGISTER
Whether to reregister the wallet if it is not already registered.
--axon.priority.max_workers AXON.PRIORITY.MAX_WORKERS
maximum number of threads in thread pool
--axon.priority.maxsize AXON.PRIORITY.MAXSIZE
maximum size of tasks in priority queue
--axon.port AXON.PORT
The local port this axon endpoint is bound to. i.e. 8091
--axon.ip AXON.IP The local ip this axon binds to. ie. [::]
--axon.external_port AXON.EXTERNAL_PORT
The public port this axon broadcasts to the network. i.e. 8091
--axon.external_ip AXON.EXTERNAL_IP
The external ip this axon broadcasts to the network to. ie. [::]
--axon.max_workers AXON.MAX_WORKERS
The maximum number connection handler threads working simultaneously on this endpoint. The grpc server distributes
new worker threads to service requests up to this number.
--axon.maximum_concurrent_rpcs AXON.MAXIMUM_CONCURRENT_RPCS
Maximum number of allowed active connections
--subtensor.network SUBTENSOR.NETWORK
The subtensor network flag. The likely choices are: -- finney (main network) -- local (local running network) --
mock (creates a mock connection (for testing)) If this option is set it overloads subtensor.chain_endpoint with an
entry point node from that network.
--subtensor.chain_endpoint SUBTENSOR.CHAIN_ENDPOINT
The subtensor endpoint flag. If set, overrides the --network flag.
--subtensor._mock To turn on subtensor mocking for testing purposes.
--subtensor.register.num_processes SUBTENSOR.REGISTER.NUM_PROCESSES, -n SUBTENSOR.REGISTER.NUM_PROCESSES
Number of processors to use for registration
--subtensor.register.update_interval SUBTENSOR.REGISTER.UPDATE_INTERVAL, --subtensor.register.cuda.update_interval SUBTENSOR.REGISTER.UPDATE_INTERVAL, --cuda.update_interval SUBTENSOR.REGISTER.UPDATE_INTERVAL, -u SUBTENSOR.REGISTER.UPDATE_INTERVAL
The number of nonces to process before checking for next block during registration
--subtensor.register.no_output_in_place, --no_output_in_place
Whether to not ouput the registration statistics in-place. Set flag to disable output in-place.
--subtensor.register.verbose
Whether to ouput the registration statistics verbosely.
--subtensor.register.cuda.use_cuda, --cuda, --cuda.use_cuda
Set flag to use CUDA to register.
--subtensor.register.cuda.no_cuda, --no_cuda, --cuda.no_cuda
Set flag to not use CUDA for registration
--subtensor.register.cuda.dev_id SUBTENSOR.REGISTER.CUDA.DEV_ID [SUBTENSOR.REGISTER.CUDA.DEV_ID ...], --cuda.dev_id SUBTENSOR.REGISTER.CUDA.DEV_ID [SUBTENSOR.REGISTER.CUDA.DEV_ID ...]
Set the CUDA device id(s). Goes by the order of speed. (i.e. 0 is the fastest).
--subtensor.register.cuda.TPB SUBTENSOR.REGISTER.CUDA.TPB, --cuda.TPB SUBTENSOR.REGISTER.CUDA.TPB
Set the number of Threads Per Block for CUDA.
--logging.debug Turn on bittensor debugging information
--logging.trace Turn on bittensor trace level information
--logging.record_log Turns on logging to file.
--logging.logging_dir LOGGING.LOGGING_DIR
Logging default root directory.
--metagraph._mock To turn on metagraph mocking for testing purposes.
--config CONFIG If set, defaults are overridden by passed file.
--strict If flagged, config will check that only exact arguemnts have been set.
```
Loading