Commit Graph

413 Commits

Author SHA1 Message Date
jgrusewski
ea608b2d80 fix: precompute runs on ci-compile-cpu (pure CPU, no GPU needed)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 23:24:35 +02:00
jgrusewski
5c4a892e7b fix: create-tag tolerates existing tags instead of failing the workflow
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 23:12:30 +02:00
jgrusewski
038a8db16f infra: add feature-cache-pvc volume to all training wrapper templates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 23:11:05 +02:00
jgrusewski
cb543dea1d infra: precompute writes to feature-cache-pvc (not training-data PVC)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 22:58:10 +02:00
jgrusewski
088745336e infra: wire feature-cache-pvc into compile-and-train pipeline
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 22:57:34 +02:00
jgrusewski
ab2be57e98 infra: add feature-cache-pvc (persistent fxcache storage)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 22:56:22 +02:00
jgrusewski
00446aeeb7 fix: fxcache to /workspace/ (PVC is read-only, workspace is emptyDir writable)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 22:01:46 +02:00
jgrusewski
c1cac1066a fix: remove volume-level readOnly on training-data PVC (precompute needs write)
Per-mount readOnly: true is still set on hyperopt/train/evaluate steps.
Only the precompute step gets write access to generate fxcache.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 21:38:29 +02:00
jgrusewski
9a2320d1ca fix: precompute runs from /workspace/bin/ (PVC /data/ is read-only for mkdir)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 21:26:26 +02:00
jgrusewski
24113247a9 fix: precompute runs on GPU node (PVC is RWO), copies binary from workspace
PVC is ReadWriteOnce — can't mount on compile node (different pool).
Precompute step now:
- runs on GPU node (same as training, shares PVC mount)
- depends on fetch-binary (gets binary from GitLab to /workspace/)
- copies binary to /data/bin/ on PVC for future use
- skips if cache already exists (data unchanged)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 21:02:32 +02:00
jgrusewski
047c01dcfa fix: precompute skips if cache exists + integrated into compile-and-train
- precompute_features early-exits if {cache_key}.fxcache already exists
  (cache key = SHA256 of filenames + sizes, only changes when data changes)
- compile-and-train copies binaries to PVC /data/bin/ after compile
- precompute step added to compile-and-train DAG (runs after compile,
  before training, parallel with GPU warmup)
- precompute template reads binary from PVC (no GitLab download)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 20:43:41 +02:00
jgrusewski
efd7b39b33 fix: precompute fetches binary from GitLab packages before running
Was relying on stale binary at /data/bin/precompute_features on PVC.
Now downloads latest from GitLab Package Registry (uploaded by
compile-and-train). Falls back to PVC binary if download fails.

Also added precompute_features to compile-and-train examples list.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 19:51:28 +02:00
jgrusewski
3f7ba95c48 fix: add precompute_features to compile-and-train examples list
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 19:49:11 +02:00
jgrusewski
bc1f20dd78 fix: add nvcc to ci-builder-cpu image for cudarc .cubin precompilation
cuda-nvcc-12-4 + cuda-cudart-dev-12-4 (~400MB) added to the CPU builder.
Reverts compile-and-deploy back to ci-builder-cpu (was briefly switched
to full ci-builder which is 6GB+ and unnecessary).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 19:21:30 +02:00
jgrusewski
5a70b376d7 fix: compile-and-deploy uses ci-builder (with nvcc) instead of ci-builder-cpu
cudarc build.rs requires nvcc to precompile CUDA kernels to .cubin files.
The ci-builder-cpu image doesn't have the CUDA toolkit installed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 19:19:35 +02:00
jgrusewski
dc8c8fb897 fix: Argo precompute uses --symbol filter (no double-nested data-dir)
Previously appended /${SYMBOL} to data-dir AND passed --symbol, causing
double nesting. Now data-dir stays as-is and --symbol handles filtering
via collect_dbn_files_filtered.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 19:05:23 +02:00
jgrusewski
34df9adc8f fix: force line-buffered stdout in Argo training pod
Rust tracing with JSON subscriber in a container without TTY uses
fully-buffered stdout — logs only flush on buffer full or process exit.
This made H100 training appear stuck for 28+ minutes with no output.
stdbuf -oL forces line buffering so epoch logs appear immediately.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 16:03:30 +02:00
jgrusewski
9aad6ff60e refactor: remove max_training_steps_per_epoch — always train full dataset
Epoch duration self-balances: bigger GPU → bigger auto-scaled batch →
fewer steps per epoch. The manual cap created 7 different values
(0, 8, 64, 100, 200, 300, 2000) across configs/tests/examples, making
behavior inconsistent between environments.

Removed from: DQNHyperparameters, training profiles (smoketest,
localdev, production), CLI args, Argo templates, hyperopt adapter,
all test overrides, supervised example.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 14:41:16 +02:00
jgrusewski
5fe6acc99b chore: remove --batch-size from Argo GPU test template — auto from VRAM
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 14:37:12 +02:00
jgrusewski
28ad7cece1 fix: align precompute data-dir with train_baseline_rl symbol subdir
precompute passes data-dir/SYMBOL to match how train_baseline_rl
calls load_all_bars(data_dir, symbol). compile-and-train gets
FOXHUNT_FEATURE_CACHE_DIR env var and --epochs fix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:09:06 +02:00
jgrusewski
f01c7f8181 fix: baseline-rl template adds required volumes + volumeClaimTemplates
Mirrors train-dqn's volume setup: git-ssh-key, training-data (rw),
cargo-target-cuda, workspace (dynamic PVC). training-data NOT
readOnly — needs write for checkpoints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:05:38 +02:00
jgrusewski
55444f7f42 refactor: baseline-rl wraps compile-and-train, fix fxcache + epochs
compile-and-train:
- Added feature-cache-dir parameter + FOXHUNT_FEATURE_CACHE_DIR env
- Fixed --max-steps-per-epoch → --epochs on train-best step

train-baseline-rl:
- Thin wrapper: templateRef to compile-and-train with hyperopt-trials=0
- No duplicate infrastructure — reuses compile, gpu-warmup, fetch-binary

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:01:19 +02:00
jgrusewski
8507827ad0 fix: workspace uses volumeClaimTemplate (shared PVC across DAG tasks)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:57:38 +02:00
jgrusewski
614a7f24d0 fix: volume name cargo-target-cuda matches compile-and-train template
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:48:57 +02:00
jgrusewski
a075d3d963 feat: standalone train-baseline-rl workflow with compile + fxcache
Reuses compile-training, gpu-warmup, fetch-binary templates from
compile-and-train. Own train step runs train_baseline_rl directly
with --epochs, FOXHUNT_FEATURE_CACHE_DIR, and fxcache validation.
No hyperopt — pure baseline with default params.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:45:28 +02:00
jgrusewski
6928ebe1b2 fix: cargo-target-pvc → cargo-target-cpu (correct PVC name)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:39:35 +02:00
jgrusewski
f9609baff6 fix: train-baseline-rl compiles in-cluster, requires fxcache
- DAG: compile (ci-compile-cpu) + gpu-warmup → train (H100)
- Compiles from source targeting compute cap 90
- fxcache REQUIRED — fails if no .fxcache found
- Error chains printed with {:#} for full cause visibility
- Uses cargo-target-pvc for compile cache + sccache

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:37:23 +02:00
jgrusewski
0cf184a9f2 fix: train-baseline-rl uses ci-builder image with CUDA libs
Fixed ubuntu:24.04 → ci-builder for GPU runtime. Added LD_LIBRARY_PATH
stub removal. H100 detects GPU but DQNTrainer creation fails — needs
investigation (likely PER buffer allocation at 10M × 3 regime heads).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:34:32 +02:00
jgrusewski
dea78ef60c feat: train-baseline-rl Argo template — direct walk-forward training
Dedicated workflow for baseline RL training without hyperopt.
Runs train_baseline_rl binary on GPU node with fxcache.
Fetches pre-compiled binary from MinIO, falls back to PVC.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:27:46 +02:00
jgrusewski
1d0ed5afd1 feat: shared argo-base-egress policy for DNS, K8s API, MinIO, Mattermost
All pods with app.kubernetes.io/part-of=foxhunt get base infra
access. Fixes MinIO log archival timeout for precompute-features
and databento-download workflows. Component-specific policies
still add extra rules (GitLab SSH, external HTTPS, etc.).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:10:18 +02:00
jgrusewski
891be68c18 fix: increase precompute memory limit to 56Gi for 61M MBP-10 snapshots
Previous 32Gi OOM'd with 148GB of MBP-10 data (61M snapshots ≈ 15GB
in memory + trades + OHLCV). ci-compile-cpu node has 64GB.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 09:44:56 +02:00
jgrusewski
bdcb765e32 feat: train-dqn template passes feature-cache-dir to trainer
Adds feature-cache-dir parameter (default: /data/feature-cache) so
the training binary can load pre-computed .fxcache files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 00:00:38 +02:00
jgrusewski
cba407b79d feat: Argo precompute-features template + argo-precompute.sh CLI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:59:34 +02:00
jgrusewski
aa1accf5b7 chore: remove old Python-based Databento batch download job
All downloads now use the Rust download_baseline binary via the
Argo WorkflowTemplate (databento-download).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:03:03 +02:00
jgrusewski
3ca1f92339 fix: lower download template resources to fit platform nodes
500m/512Mi request fits alongside existing platform workloads.
Download is I/O-bound, not CPU-bound.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:00:00 +02:00
jgrusewski
cb8afe3caf feat: parameterized Argo WorkflowTemplate for Databento downloads
Replace hardcoded K8s Job with reusable Argo WorkflowTemplate
(databento-download) parameterized by schema, output-dir, parallel,
and node-pool. Add argo-download.sh CLI wrapper matching the
argo-train.sh pattern. Remove old streaming job file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 22:40:37 +02:00
jgrusewski
fda01452c9 fix: Databento download — run as root for apt, fix output-dir path
Remove runAsUser:1000 so apt-get install ca-certificates works.
Fix double-nested ES.FUT path (output-dir is the schema root, not ES.FUT subdir).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 21:58:19 +02:00
jgrusewski
67af21449e fix: Databento streaming download — CA certs + all 4 schemas
Root cause: ubuntu:24.04 has no CA certificates, rustls-native-certs
fails TLS handshake. Fix: apt-get install ca-certificates before
running download binary. Also add port 80 to network policy for apt.

Downloads OHLCV-1m, Trades, OHLCV-1s, MBP-10 via streaming API
(get_range) — parallel quarterly downloads, individual .dbn.zst files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 21:48:28 +02:00
jgrusewski
3b77359e74 fix: use ci-compile-cpu node for Databento download (faster bandwidth) 2026-03-31 17:35:43 +02:00
jgrusewski
97d2ba87a2 fix: Databento download job — HOME=/tmp for pip, network policy label
Set HOME=/tmp to fix pip cache ownership, --no-cache-dir for clean install.
Label compile-and-train matches network policy for HTTPS egress.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 17:22:41 +02:00
jgrusewski
514285a59b feat: Databento batch download K8s job — all 5 schemas to training PVC
Downloads completed batch jobs (mbp-10, trades, ohlcv-1m, ohlcv-1s, mbp-1)
to training-data-pvc. Cleans old data per schema before downloading.
Uses existing databento-credentials secret.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 13:06:38 +02:00
jgrusewski
05fc1783e1 feat: configurable --min-hold-bars for A/B testing (3 vs 5)
Add --min-hold-bars CLI arg to train_baseline_rl and hyperopt_baseline_rl.
Wire through Argo workflow as parameter. Default 5 (TOML), override via
CLI for quick A/B experiments without config changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 11:12:13 +02:00
jgrusewski
ec88b6aaa4 fix: add volumes to all train-* templates for compile-and-train compat
templateRef doesn't inherit workflow-level volumes from the referenced
template. All 3 train wrappers (DQN, PPO, supervised) now define
git-ssh-key, training-data, cargo-target-cuda volumes and workspace
volumeClaimTemplate locally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 10:20:06 +02:00
jgrusewski
cbce684546 refactor: align PPO + supervised templates with compile-and-train
Migrate from training-pipeline (requires pre-built binary-tag) to
compile-and-train (compiles from source). All 3 train templates now
use the same pattern: thin wrapper → compile-and-train → pipeline.

Consistent params: commit-sha + git-branch instead of binary-tag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 10:17:23 +02:00
jgrusewski
3ccbac47f6 fix: train-dqn params aligned with compile-and-train (commit-sha + git-branch)
Was using commit-ref which doesn't exist in compile-and-train template.
Now passes commit-sha=HEAD + git-branch=main matching the parent template.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 10:15:44 +02:00
jgrusewski
8889961837 fix: YAML indentation in train-supervised-template (same bug as PPO)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 10:10:32 +02:00
jgrusewski
1e983ea61a fix: YAML indentation in train-ppo-template (broke apply-argo-templates CI step)
Line 18 had 6-space indent instead of 4 under metadata.labels.
This caused all CI pipelines to fail at apply-argo-templates since our
compile-and-train changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 10:06:56 +02:00
jgrusewski
261cb3bac2 feat: wire --initial-capital into train_baseline_rl + Argo workflow
train_baseline_rl now accepts --initial-capital (default $35K) matching
hyperopt. Argo compile-and-train passes the workflow parameter to the
train-best step. Both hyperopt and training now use consistent capital.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 09:58:51 +02:00
jgrusewski
92d59ef529 fix: single-pass 14D hyperopt in Argo workflow — remove redundant phases
With family-based 14D search space, Phase Fast already searches all dims.
Phases 2-4 (Full/Reward/Risk) were designed for the old 30D space where
each phase explored different parameter subsets. Now redundant — saves
3× hyperopt compute per training run.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 09:54:25 +02:00
jgrusewski
58e09a52ac fix(ci): train-dqn uses compile-and-train (no pre-built binary dependency)
Was referencing training-pipeline which needs binary-tag for pre-built
binaries from GitLab packages. Now references compile-and-train which
compiles from source then trains. No stale binary risk.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:44:08 +02:00