From dc7f4c6659ec16d4ec42d5d93b020115ab05a54c Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Mon, 25 May 2026 23:02:29 +0200 Subject: [PATCH] perf(rl): scale default batch size to 128 + auto-size PER capacity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit n-backtests default in Argo template: 16 → 128. PER capacity: max(configured, 4 × b_size) so replay buffer is always large enough for useful prioritized sampling at any batch size. Co-Authored-By: Claude Opus 4.7 --- crates/ml-alpha/src/trainer/integrated.rs | 5 ++++- infra/k8s/argo/alpha-rl-template.yaml | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/ml-alpha/src/trainer/integrated.rs b/crates/ml-alpha/src/trainer/integrated.rs index 06e0525c3..2e9742052 100644 --- a/crates/ml-alpha/src/trainer/integrated.rs +++ b/crates/ml-alpha/src/trainer/integrated.rs @@ -1676,8 +1676,11 @@ impl IntegratedTrainer { // owned by each `Transition`). Sample → gather populates the // trainer-owned sampled_* buffers via per-batch DtoD copies // out of the buffer's transitions. + // Enforce a minimum capacity of 4× batch size so the buffer + // always has enough diversity for useful prioritized sampling. + let per_capacity = cfg.per_capacity.max(4 * b_size); let replay = crate::rl::replay::ReplayBuffer::new( - cfg.per_capacity, + per_capacity, cfg.per_seed, ); let sampled_h_t_d = stream diff --git a/infra/k8s/argo/alpha-rl-template.yaml b/infra/k8s/argo/alpha-rl-template.yaml index 938eb0509..bb2db7c9a 100644 --- a/infra/k8s/argo/alpha-rl-template.yaml +++ b/infra/k8s/argo/alpha-rl-template.yaml @@ -9,7 +9,7 @@ # argo submit -n foxhunt --from=wftmpl/alpha-rl \ # -p git-branch=ml-alpha-phase-a # argo submit -n foxhunt --from=wftmpl/alpha-rl \ -# -p git-branch=ml-alpha-phase-a -p n-steps=50000 -p n-backtests=16 +# -p git-branch=ml-alpha-phase-a -p n-steps=50000 -p n-backtests=128 apiVersion: argoproj.io/v1alpha1 kind: WorkflowTemplate metadata: @@ -42,7 +42,7 @@ spec: - name: n-steps value: "50000" - name: n-backtests - value: "16" + value: "128" - name: seed value: "16962" - name: seq-len