Three bugs causing the baseline RL training to hang on first epoch while smoketest completes in 1.2s: 1. VRAM oversubscription (hang root cause): detect_gpu_hardware auto-scaling computed n_episodes without accounting for 2x counterfactual doubling or dtod_clone allocations, causing 4x actual memory vs budget. Replaced with configurable gpu_n_episodes field (smoketest=32, localdev=128, prod=4096). 2. Counterfactual experiences silently dropped: build_next_states_f32 received n_episodes instead of n_episodes*2, and PER insert used base count instead of doubled count — ~50% of augmented training data was generated then lost. 3. CudaEvent leak in hot loop: record_event(None) created+destroyed 8000 events per epoch in forward_online_raw/f32. Pre-allocated 4 events in CublasForward struct, eliminating driver overhead and handle leaks during CUDA Graph capture. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
119 lines
2.8 KiB
TOML
119 lines
2.8 KiB
TOML
# DQN Local Dev Profile — extended training on RTX 3050 (4GB VRAM)
|
||
# Larger buffer + more episodes than smoketest for meaningful convergence.
|
||
# gpu_n_episodes=auto × gpu_timesteps=200 (auto-scaled from VRAM)
|
||
# buffer_size=50K → fills over ~4 epochs, reducing memorization
|
||
|
||
[training]
|
||
epochs = 200
|
||
batch_size = 64
|
||
learning_rate = 0.0001
|
||
gamma = 0.95
|
||
weight_decay = 0.0001
|
||
adam_epsilon = 1e-8
|
||
warmup_steps = 0
|
||
hidden_dim_base = 64
|
||
reward_scale = 1.0
|
||
huber_delta = 1.0
|
||
lr_decay_type = 2
|
||
lr_min = 0.00001
|
||
# Data source: "ohlcv" for local dev (may not have MBP-10 data)
|
||
data_source = "ohlcv"
|
||
# OFI feature enrichment from MBP-10 order book data (8 features: OFI L1/L5, depth imbalance, VPIN, Kyle's lambda, bid/ask slope, trade imbalance)
|
||
# mbp10_data_dir = "test_data/futures-baseline-mbp10"
|
||
|
||
[distributional]
|
||
num_atoms = 51
|
||
|
||
[exploration]
|
||
epsilon_start = 1.0
|
||
epsilon_end = 0.05
|
||
epsilon_decay = 0.85
|
||
noisy_sigma_init = 0.3
|
||
entropy_coefficient = 0.001
|
||
count_bonus_coefficient = 0.1
|
||
q_gap_threshold = 0.05
|
||
|
||
[replay_buffer]
|
||
buffer_size = 50000
|
||
min_replay_size = 500
|
||
regime_replay_decay = 0.3
|
||
|
||
[early_stopping]
|
||
enabled = true
|
||
patience = 20
|
||
min_epochs_before_stopping = 80
|
||
|
||
[experience]
|
||
gpu_timesteps_per_episode = 200
|
||
gpu_n_episodes = 128
|
||
min_hold_bars = 3
|
||
|
||
[experience.fill_simulation]
|
||
ioc_fill_prob = 0.85
|
||
limit_fill_min = 0.30
|
||
limit_fill_max = 0.80
|
||
spread_cost_frac = 0.50
|
||
spread_capture_frac = 0.50
|
||
|
||
[risk]
|
||
max_position = 2.0
|
||
loss_aversion = 1.5
|
||
q_clip_min = -50.0
|
||
q_clip_max = 50.0
|
||
|
||
[advanced]
|
||
n_steps = 3
|
||
tau = 0.005
|
||
c51_warmup_epochs = 5
|
||
her_ratio = 0.2
|
||
cql_alpha = 1.0
|
||
curiosity_weight = 0.1
|
||
iqn_lambda = 0.25
|
||
spectral_norm_sigma_max = 1.5
|
||
spectral_decoupling_lambda = 0.01
|
||
gradient_clip_norm = 1.0
|
||
|
||
[generalization]
|
||
shrink_perturb_interval = 20
|
||
shrink_perturb_alpha = 0.85
|
||
shrink_perturb_sigma = 0.01
|
||
adversarial_dd_threshold = 0.005
|
||
adversarial_epochs_trigger = 5
|
||
anti_lr_good_mult = 3.0
|
||
anti_lr_bad_mult = 0.3
|
||
anti_lr_sharpe_threshold = 0.3
|
||
feature_mask_fraction = 0.3
|
||
feature_noise_scale = 0.1
|
||
causal_weight = 0.1
|
||
causal_intervention_interval = 10
|
||
adversarial_warmup_epochs = 50
|
||
adversarial_checkpoint_interval = 50
|
||
bottleneck_dim = 0
|
||
stochastic_depth_prob = 0.2
|
||
asymmetric_dd_weight = 0.5
|
||
time_reversal_mod = 5
|
||
regret_blend = 0.3
|
||
position_entropy_weight = 0.01
|
||
trade_clustering_penalty = 0.05
|
||
ensemble_disagreement_penalty = 0.3
|
||
mixup_alpha = 0.2
|
||
# Core family intensity scalars for hyperopt (1.0 = neutral, range [0.0, 2.0])
|
||
learning_intensity = 1.0
|
||
exploration_intensity = 1.0
|
||
replay_intensity = 1.0
|
||
architecture_intensity = 1.0
|
||
risk_intensity = 1.0
|
||
# Generalization family intensity scalars for hyperopt (1.0 = neutral, range [0.0, 2.0])
|
||
adversarial_intensity = 1.0
|
||
regularization_intensity = 1.0
|
||
augmentation_intensity = 1.0
|
||
loss_shaping_intensity = 1.0
|
||
ensemble_intensity = 1.0
|
||
causal_intensity = 1.0
|
||
|
||
[reward]
|
||
loss_aversion = 1.5
|
||
q_gap_threshold = 0.1
|
||
w_dd = 1.0
|
||
dd_threshold = 0.02
|