|
Download kaggle/KAGGLE_SETUP.md from vanishingradient/deepagents-rl-coding: direct link, hf CLI and curl.
- Browser
- Download file 2.71 kB
-
https://huggingface.co/vanishingradient/deepagents-rl-coding/resolve/main/kaggle/KAGGLE_SETUP.md
- Command line
-
hf download hf://vanishingradient/deepagents-rl-coding/kaggle/KAGGLE_SETUP.md
-
curl -L -o KAGGLE_SETUP.md https://huggingface.co/vanishingradient/deepagents-rl-coding/resolve/main/kaggle/KAGGLE_SETUP.md
2.71 kB
| # Kaggle agent GRPO dispatch (deepagents + SWE Docker reward) | |
| ## Architecture | |
| 1. **Kaggle T4×2** — Qwen QLoRA + TRL `GRPOTrainer` + `DeepAgentSWEEnv` (git checkout + deepagents tools) | |
| 2. **This machine** — `scripts/swe_grader_server.py` runs official Docker `evaluate_model_patch` | |
| 3. Tunnel (`cloudflared` / ngrok) exposes the grader; Kaggle calls `SWE_GRADER_URL` | |
| ## 1. Local grader (keep running for the whole kernel) | |
| ```bash | |
| # Docker Desktop must be up (port 8787 may be taken — default 8788) | |
| python scripts/swe_grader_server.py --host 127.0.0.1 --port 8788 | |
| # separate terminal — public HTTPS URL | |
| ngrok http 8788 | |
| # or: cloudflared tunnel --url http://127.0.0.1:8788 | |
| ``` | |
| Optional auth: set `SWE_GRADER_TOKEN` in `.env` (same value in Kaggle secrets). | |
| Smoke: | |
| ```bash | |
| curl -s http://127.0.0.1:8787/health | |
| # POST /grade with gold patch should FULL-resolve (see verify script / notebook smoke) | |
| ``` | |
| ## 2. Notebook settings | |
| - **Accelerator:** GPU T4 x2 | |
| - **Internet:** On | |
| - **Language:** Python | |
| ## 3. Secrets (API path — recommended) | |
| ```bash | |
| # .env must include SWE_GRADER_URL=https://....trycloudflare.com | |
| # and optional SWE_GRADER_TOKEN | |
| python scripts/push_kaggle_secrets_dataset.py | |
| kaggle kernels push -p notebooks/ | |
| ``` | |
| Notebook loads `/kaggle/input/.../secrets.json` first, then Add-ons → Secrets. | |
| **Required keys:** `HF_TOKEN`, `WANDB_API_KEY`, `LANGFUSE_*`, **`SWE_GRADER_URL`** | |
| **Do not** make `deepagents-rl-secrets` public. | |
| ## 4. Checkpoint / observability contract | |
| Every `save_steps` (default 5): | |
| 1. Held-out **agent** eval on SWE Lite (`n_eval=2` smoke) | |
| 2. Langfuse trace `kaggle-ckpt-eval` + scores | |
| 3. W&B `eval/*` metrics | |
| 4. **Then** push LoRA to `vanishingradient/deepagents-rl-coding` revision `grpo-step-{n}` | |
| Baseline eval at step 0 runs before training starts. | |
| ## 5. Upload / run | |
| ```bash | |
| python scripts/push_trainer_to_hf.py | |
| kaggle kernels push -p notebooks/ | |
| # start the kernel in the Kaggle UI (or kernels status / pull) | |
| ``` | |
| ## 6. Watch | |
| - Langfuse: | |
| - `grpo-swe-rollout` — **every train/eval episode**: nested `ls` / `read_file` / … tool spans + `reward_grader` | |
| - `kaggle-ckpt-eval` — checkpoint aggregate (+ links to rollout trace ids) | |
| - ckpt eval also logs `llm-turn-*` generation spans under each rollout | |
| - W&B: project `deepagents-rl-coding`, run `kaggle-grpo-swe` | |
| - HF: https://huggingface.co/vanishingradient/deepagents-rl-coding/tree/main | |
| - Local grader logs: each `/grade` call | |
| ## Notes | |
| - First launch is a **smoke** GRPO (`max_steps=20`, `num_generations=2`, short tool budget). | |
| - Keep Docker Desktop + grader + tunnel alive until the kernel finishes. | |