Skip to content

Configuration

Relevant Source Files

This document covers the configuration system for the NI Compute Subnet, including static configuration constants, command-line argument parsing, GPU performance parameters, and runtime configuration options. The configuration system manages settings for validators, miners, and the resource allocation API across the entire compute subnet infrastructure.

For information about command-line argument usage in specific components, see Command-line Arguments. For GPU performance benchmarks and hardware-specific settings, see GPU Performance Configuration.

The configuration system operates through multiple layers and sources that provide settings for different aspects of the compute subnet:

graph TB
    subgraph "Configuration Sources"
        CLI["Command Line Arguments<br/>ComputeArgPaser"]
        YAML["config.yaml<br/>GPU Performance Data"]
        STATIC["compute/__init__.py<br/>Static Constants"]
        ENV["Environment Variables<br/>.env file"]
    end
    
    subgraph "Configuration Categories"
        NETWORK["Network Configuration<br/>netuid, timeout values"]
        GPU_CONFIG["GPU Configuration<br/>performance data, tolerance"]
        MINER_CONFIG["Miner Configuration<br/>hashcat, whitelist settings"]
        VALIDATOR_CONFIG["Validator Configuration<br/>batch sizes, thresholds"]
        POG_CONFIG["Proof-of-GPU Configuration<br/>merkle proof settings"]
    end
    
    subgraph "Target Components"
        MINER["Miner Process<br/>neurons/miner.py"]
        VALIDATOR["Validator Process<br/>neurons/validator.py"]
        API["RegisterAPI<br/>FastAPI Service"]
    end
    
    CLI --> NETWORK
    CLI --> MINER_CONFIG
    CLI --> VALIDATOR_CONFIG
    
    YAML --> GPU_CONFIG
    YAML --> POG_CONFIG
    
    STATIC --> NETWORK
    STATIC --> MINER_CONFIG
    STATIC --> POG_CONFIG
    
    ENV --> API
    
    NETWORK --> MINER
    NETWORK --> VALIDATOR
    NETWORK --> API
    
    GPU_CONFIG --> VALIDATOR
    MINER_CONFIG --> MINER
    VALIDATOR_CONFIG --> VALIDATOR
    POG_CONFIG --> VALIDATOR

Sources: compute/__init__.py:1-93 , config.yaml:1-104 , compute/utils/parser.py:1-170

The compute subnet defines core system parameters as static constants in the main module. These constants control network behavior, validation timing, and system limits:

graph LR
    CONSTANTS["compute/__init__.py"] --> NETWORK_PARAMS["`Network Parameters
    validator_permit_stake: 1.0e4
    weights_rate_limit: 100
    specs_timeout: 60`"]
    
    CONSTANTS --> POG_PARAMS["`Proof-of-GPU Parameters
    pog_retry_limit: 30
    pog_retry_interval: 80
    pow_timeout: 30`"]
    
    CONSTANTS --> MINER_PARAMS["`Miner Parameters
    miner_priority_specs: 1
    miner_priority_challenge: 2
    miner_priority_allocate: 3`"]
    
    CONSTANTS --> SECURITY["`Security Lists
    SUSPECTED_EXPLOITERS_HOTKEYS
    TRUSTED_VALIDATORS_HOTKEYS`"]

Key configuration constants include:

CategoryConstantDefault ValuePurpose
Networkvalidator_permit_stake1.0e4Minimum stake required for validator
Networkweights_rate_limit100Rate limit for weight updates
Validationspecs_timeout60Timeout for hardware specs queries
Proof-of-GPUpog_retry_limit30Maximum PoG retry attempts
Proof-of-GPUpog_retry_interval80Seconds between PoG retries
Proof-of-Workpow_min_difficulty7Minimum PoW difficulty
Proof-of-Workpow_max_difficulty12Maximum PoW difficulty
Minerminer_hashcat_location"hashcat"Default hashcat binary path

Sources: compute/__init__.py:29-58

The system maintains predefined lists of trusted validators and suspected exploiters:

graph TB
    SECURITY_CONFIG["Security Configuration"] --> TRUSTED["TRUSTED_VALIDATORS_HOTKEYS<br/>List of verified validator hotkeys"]
    SECURITY_CONFIG --> EXPLOITERS["SUSPECTED_EXPLOITERS_HOTKEYS<br/>List of blacklisted hotkeys"]
    
    TRUSTED --> VALIDATOR_PROCESS["Validator Whitelist Logic"]
    EXPLOITERS --> BLACKLIST_FILTER["Automatic Blacklisting"]

Sources: compute/__init__.py:59-92

The ComputeArgPaser class extends Python’s ArgumentParser to provide comprehensive command-line configuration for both miners and validators:

graph TB
    PARSER["ComputeArgPaser"] --> BASE_ARGS["`Base Arguments
    --netuid: Subnet ID
    --auto_update: Auto-update flag
    --blacklist.exploiters: Use exploiter list`"]
    
    PARSER --> BLACKLIST_ARGS["`Blacklist/Whitelist
    --blacklist.hotkeys
    --blacklist.coldkeys
    --whitelist.hotkeys
    --whitelist.coldkeys`"]
    
    PARSER --> VALIDATOR_ARGS["`Validator Arguments
    --validator.whitelist.unrecognized
    --validator.perform.hardware.query
    --validator.challenge.batch.size
    --validator.specs.batch.size`"]
    
    PARSER --> MINER_ARGS["`Miner Arguments
    --miner.hashcat.path
    --miner.hashcat.workload.profile
    --miner.whitelist.not.enough.stake
    --ssh.port`"]
    
    PARSER --> BITTENSOR_ARGS["`Bittensor Integration
    bt.subtensor.add_args()
    bt.logging.add_args()
    bt.wallet.add_args()
    bt.axon.add_args()`"]

The parser organizes arguments into logical categories:

CategoryMethodArguments
Base__init__netuid, auto_update, blacklist/whitelist options
Validatoradd_validator_argument()batch sizes, hardware query settings, thresholds
Mineradd_miner_argument()hashcat configuration, SSH port, whitelist settings
BittensorBuilt-insubtensor, logging, wallet, axon arguments

Sources: compute/utils/parser.py:8-71 , compute/utils/parser.py:72-115 , compute/utils/parser.py:116-166

The config.yaml file contains comprehensive GPU performance data used for validation and scoring:

graph TB
    GPU_CONFIG["config.yaml"] --> PERF_DATA["`GPU Performance Data
    GPU_TFLOPS_FP16: FP16 performance
    GPU_TFLOPS_FP32: FP32 performance
    GPU_AVRAM: Available VRAM`"]
    
    GPU_CONFIG --> TOLERANCE["`Tolerance Pairs
    gpu_tolerance_pairs:
    Similar GPU mappings`"]
    
    GPU_CONFIG --> SCORES["`GPU Scores
    gpu_scores:
    Scoring weights by model`"]
    
    PERF_DATA --> IDENTIFICATION["GPU Identification Logic<br/>identify_gpu()"]
    TOLERANCE --> VALIDATION["Performance Validation<br/>Tolerance Handling"]
    SCORES --> SCORING["Miner Scoring System"]

The GPU configuration includes three main performance categories:

  1. FP16 Performance (GPU_TFLOPS_FP16): Theoretical FP16 TFLOPS for each GPU model
  2. FP32 Performance (GPU_TFLOPS_FP32): Theoretical FP32 TFLOPS for each GPU model
  3. Available VRAM (GPU_AVRAM): Effective VRAM capacity in GB

Example configuration structure:

gpu_performance:
GPU_TFLOPS_FP16:
NVIDIA H100: 330
NVIDIA A100-SXM4-80GB: 238.8
GPU_TFLOPS_FP32:
NVIDIA H100: 37.2
NVIDIA A100-SXM4-80GB: 18.2
GPU_AVRAM:
NVIDIA H100: 34.36
NVIDIA A100-SXM4-80GB: 34.36

Sources: config.yaml:1-94

The configuration defines tolerance pairs for GPUs with similar performance characteristics and assigns scoring weights:

graph LR
    TOLERANCE_PAIRS["gpu_tolerance_pairs"] --> SIMILAR_GPUS["`Similar GPU Pairs
    NVIDIA L40 ↔ NVIDIA RTX 6000 Ada
    NVIDIA A100 variants ↔ similar models`"]
    
    GPU_SCORES["gpu_scores"] --> SCORE_WEIGHTS["`Scoring Weights
    NVIDIA H200: 4.0
    NVIDIA H100: 2.80
    NVIDIA A100-SXM4-80GB: 1.90`"]
    
    SIMILAR_GPUS --> VALIDATION_TOLERANCE["Validation Tolerance Logic"]
    SCORE_WEIGHTS --> MINER_SCORING["Miner Performance Scoring"]

Sources: config.yaml:63-94

The system includes specific configuration for Proof-of-GPU Merkle tree operations:

ParameterDefault ValuePurpose
miner_script_path"neurons/Validator/miner_script_m_merkletree.py"Path to Merkle proof script
time_tolerance5Time tolerance for proof verification
submatrix_size512Size of submatrices for proof generation
hash_algorithm'sha256'Hash algorithm for Merkle trees
pog_retry_limit22Maximum Proof-of-GPU retry attempts
pog_retry_interval60Seconds between PoG retries
max_workers64Maximum concurrent workers
max_random_delay900Maximum random delay in seconds

Sources: config.yaml:95-104

The configuration system loads and applies settings through multiple mechanisms:

graph TB
    LOAD_CONFIG["`Configuration Loading Process`"] --> YAML_LOAD["load_yaml_config()<br/>YAML file parsing"]
    LOAD_CONFIG --> PARSER_CONFIG["ComputeArgPaser.config<br/>bt.config() integration"]
    LOAD_CONFIG --> STATIC_IMPORT["Static constant imports<br/>from compute import *"]
    
    YAML_LOAD --> GPU_IDENTIFY["identify_gpu()<br/>Performance-based identification"]
    PARSER_CONFIG --> COMPONENT_CONFIG["Component Configuration<br/>Miners, Validators, API"]
    STATIC_IMPORT --> SYSTEM_LIMITS["System Limits<br/>Timeouts, thresholds"]
    
    GPU_IDENTIFY --> POG_VALIDATION["Proof-of-GPU Validation"]
    COMPONENT_CONFIG --> RUNTIME_BEHAVIOR["Runtime Behavior Control"]
    SYSTEM_LIMITS --> NETWORK_OPERATIONS["Network Operations"]

Components access configuration through several patterns:

  1. Static Import: Direct import of constants from compute module
  2. YAML Loading: Dynamic loading of GPU performance data via load_yaml_config()
  3. Argument Parsing: Runtime configuration through ComputeArgPaser.config
  4. Environment Variables: API keys and paths from .env files

Sources: neurons/Validator/pog.py:14-26 , compute/utils/parser.py:70-71 , compute/__init__.py:1-93

Configuration Validation and Error Handling

Section titled “Configuration Validation and Error Handling”

The system includes validation mechanisms for configuration parameters:

graph TB
    VALIDATION["`Configuration Validation`"] --> YAML_VALIDATION["YAML Validation<br/>FileNotFoundError, YAMLError"]
    VALIDATION --> RANGE_VALIDATION["Range Validation<br/>pow_min_difficulty ≤ pow_max_difficulty"]
    VALIDATION --> TYPE_VALIDATION["Type Validation<br/>Numeric parameters, string paths"]
    
    YAML_VALIDATION --> ERROR_HANDLING["Error Handling<br/>Graceful degradation"]
    RANGE_VALIDATION --> BOUNDS_CHECKING["Bounds Checking<br/>Prevent invalid configurations"]
    TYPE_VALIDATION --> CONVERSION["Type Conversion<br/>String to numeric conversion"]

The configuration system provides robust error handling for common issues:

  • Missing configuration files (YAML not found)
  • Invalid YAML syntax or structure
  • Out-of-range numeric parameters
  • Invalid GPU model specifications
  • Missing required command-line arguments

Sources: neurons/Validator/pog.py:22-25 , compute/utils/math.py:16-21