config(dqn): strip H100-tuned VRAM overrides from dqn-production.toml
dqn-production.toml hard-coded three H100-tuned values that shadow
GpuProfile auto-detection: batch_size=16384, buffer_size=500K,
gpu_n_episodes=4096. After the L40S-default flip lands (prior commit
8b8bb1af7), workflow `train-ft8ph` deterministically OOMed at fold 0/1/2
with `build_next_states_f32` 4 GiB alloc — because the H100-sized
hyperparams.batch_size + buffer_size + gpu_n_episodes ate ~38 GB of the
L40S's 46 GB usable VRAM before the rollout step.
DqnTrainingProfile.apply_to() runs AFTER train_baseline_rl.rs populates
hyperparams from GpuProfile, so the production TOML always wins. All
three fields are `Option<...>` in the TOML schema — removing the lines
turns apply_to into a no-op for them, and the GpuProfile-detected values
flow through:
field | L40S | H100 | (was forced)
batch_size | 4096 | 8192 | 16384
buffer_size | 300K | 500K | 500K
gpu_n_episodes | 2048 | 4096 | 4096
Two pinned assertions in training_profile.rs::tests checked the old
contract `hp.batch_size == 16384`. Rewritten to assert
`hp.batch_size == baseline_batch_size` — locks the new contract that
VRAM-tuned values stay GpuProfile-sourced.
Lib suite 1016/0 green. Audit doc updated.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1198,12 +1198,18 @@ mod tests {
|
||||
#[test]
|
||||
fn test_apply_to_dqn_production() {
|
||||
let mut hp = crate::trainers::dqn::DQNHyperparameters::conservative();
|
||||
let baseline_batch_size = hp.batch_size;
|
||||
let profile = DqnTrainingProfile::load("dqn-production");
|
||||
profile.apply_to(&mut hp);
|
||||
|
||||
// [training] values must have been applied
|
||||
assert_eq!(hp.epochs, 200);
|
||||
assert_eq!(hp.batch_size, 16384);
|
||||
// batch_size: NOT overridden by dqn-production.toml (removed 2026-05-14
|
||||
// — H100-tuned 16384 caused OOM on L40S default; the value now flows
|
||||
// from `GpuProfile.training.batch_size`). Assertion: apply_to leaves
|
||||
// `batch_size` at the conservative() baseline so the GpuProfile-supplied
|
||||
// value (set earlier in train_baseline_rl.rs:443) flows through cleanly.
|
||||
assert_eq!(hp.batch_size, baseline_batch_size);
|
||||
assert!((hp.learning_rate - 1e-5).abs() < 1e-10);
|
||||
|
||||
// OFI MBP-10 data dir should be set in production profile
|
||||
@@ -1468,11 +1474,15 @@ mod tests {
|
||||
fn test_production_profile_applies_all_sections() {
|
||||
let profile = DqnTrainingProfile::load("dqn-production");
|
||||
let mut hp = crate::trainers::dqn::DQNHyperparameters::conservative();
|
||||
let baseline_batch_size = hp.batch_size;
|
||||
profile.apply_to(&mut hp);
|
||||
|
||||
// [training] section
|
||||
assert_eq!(hp.epochs, 200);
|
||||
assert_eq!(hp.batch_size, 16384);
|
||||
// batch_size: see test_apply_to_dqn_production — VRAM-tuned values flow
|
||||
// from GpuProfile, not the training TOML. apply_to leaves the conservative
|
||||
// baseline in place so GpuProfile values aren't shadowed.
|
||||
assert_eq!(hp.batch_size, baseline_batch_size);
|
||||
assert!((hp.learning_rate - 1e-5).abs() < 1e-10);
|
||||
assert!((hp.gamma - 0.99).abs() < 0.001);
|
||||
assert!((hp.reward_scale - 1.0).abs() < 0.01);
|
||||
|
||||
Reference in New Issue
Block a user