feat(dqn-v2): B.3 + C.5 GPU-only replay seed warm-start + CQL α ramp
Plan 3 Tasks 8 + 9. Single commit because Task 9 directly consumes Task 8's seed-fraction signal; no useful intermediate state. ISV tail-append: - [82] SEED_STEPS_TARGET_INDEX — config replay_seed_steps (CPU constructor write) - [83] SEED_STEPS_DONE_INDEX — GPU-incremented per collect_experiences_gpu - [84] SEED_FRAC_EMA_INDEX — adaptive EMA of (1 - done/target) - Fingerprint shifted [80,81] → [85,86]; ISV_TOTAL_DIM 82 → 87 GPU-only design (per user direction "fully gpu driven no cpu involvement"): - 4 scripted policies as ONE CUDA kernel (scripted_policy_kernel.cu) - Per-sample policy mix (40% uniform LCG / 20% momentum / 20% mean-rev / 20% vwap-deviation) deterministic by `i % 5` - Action source switched at launch boundary (CPU per-epoch read of ISV slot decides which kernel to dispatch; the action computation itself is 100% GPU) - No CPU physics mirror — existing GPU `experience_env_step` runs unchanged seed_step_counter_update_kernel.cu: - Single-thread cold-path; increments DONE, computes FRAC = max(0, 1-done/target) - Adaptive α matches Task 3/4 convention (α_base × (1 + 0.5×|clamp(sharpe,±2)|)) cql_alpha_seed_update_kernel.cu (Task 9): - target = config.cql_alpha × max(0, 1 - seed_frac) - During seed phase (frac=1) → target=0 → CQL α decays to 0 (no pessimism on exploration data); as frac → 0 → CQL α ramps to config value - Updates ISV[CQL_ALPHA_INDEX=48]; CQL gradient kernel reads slot 48 via pinned device-mapped ISV (Plan 1 Task 12 consumer pattern unchanged) Registry: SEED_STEPS_DONE + SEED_FRAC_EMA both FoldReset; CQL_ALPHA flipped SchemaContract → FoldReset; SEED_STEPS_TARGET stays SchemaContract. Read-only monitors (mirror PlanThresholdMonitor / StateKlMonitor pattern): - monitors/seed_monitor.rs — surfaces ISV[82..85) for HEALTH_DIAG + controller_activity smoke fire-rate - monitors/cql_alpha_monitor.rs — surfaces ISV[48] + ISV[84] dependency Smoke (RTX 3050 Ti, 3 folds × 5 epochs, dqn-smoketest profile with replay_seed_steps=1000 override so seed phase completes mid-fold): - All 3 folds saved best-checkpoint - Fold 2 best Sharpe = 92.4938 at epoch 1 (target range 80-120) ✓ - Per-fold val_metric: f0=3.80 / f1=9.73 / f2=20.24 (loss-based) - HEALTH_DIAG[3..4] cql_alpha=0.0500 with health=0.49 → base ≈ 0.10 from ISV[48], consistent with kernel ramping toward final×(1-frac); regime gate (1-regime)×health applies on top - 11 cargo check warnings (matches pre-task baseline; no new warnings) - 6/6 monitor unit tests pass (read/diagnose/observe×fire_rate) Smoke override rationale: smoke runs ~200 samples per collect (4 episodes × 50 timesteps) × 5 epochs × 3 folds ≈ 3000 total. Default 100k target would keep entire smoke in seed phase. Override to 1000 lets the seed→network transition complete mid-fold so the CQL α ramp is observable. Per pearl_one_unbounded_signal_per_reward.md: cql_alpha is bounded (clamped to config_final × (1 - seed_frac) ∈ [0, config_final]), composes safely with downstream CQL loss. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,12 @@ noise_sigma = 0.1
|
||||
buffer_size = 256
|
||||
min_replay_size = 64
|
||||
regime_replay_decay = 0.3
|
||||
# Plan 3 Task 8 B.3: smoke override. Production default 100_000; smoke runs
|
||||
# only ~200 samples per `collect_experiences_gpu` (4 episodes × 50 timesteps)
|
||||
# × 5 epochs × 3 folds ≈ 3000 total. Setting to 1_000 lets the seed phase
|
||||
# complete mid-fold so the seed→network transition is observable in the smoke
|
||||
# (HEALTH_DIAG cql_alpha.eff visibly ramps from 0 toward config.cql_alpha).
|
||||
replay_seed_steps = 1000
|
||||
|
||||
[early_stopping]
|
||||
enabled = true
|
||||
|
||||
Reference in New Issue
Block a user