-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Starter kit: align submission schema and path safety #1262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SID-6921
wants to merge
11
commits into
openai:main
Choose a base branch
from
SID-6921:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e49f73c
Add starter kit for low-budget RunPod workflow
SID-6921 f215f74
Merge pull request #1 from SID-6921/starter/full-scale-repo
SID-6921 abee85d
Align starter kit schema and harden submission path handling
SID-6921 9759195
non_record_16mb: Stock Baseline GPT 17M sp1024 A40 — val_bpb 3.2686
SID-6921 3cde174
starter_kit: address Copilot review + set author metadata
SID-6921 2ed635d
starter_kit: add 10-run A40 campaign runner and auto-ranking
SID-6921 d281106
non_record_16mb: R08 Higher-LR Matrix/Scalar GPT 17M A40 val_bpb 2.1827
SID-6921 e5db118
train: add swiglu/warmdown-frac knobs + A40 top-chase script
SID-6921 225e576
train: add scaled_dot_product_attention gqa compatibility fallback
SID-6921 60cdb1a
train: add ENABLE_COMPILE toggle and disable compile for top-chase
SID-6921 c15023e
starter_kit: add H100 top-chase campaign script
SID-6921 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Parameter Golf Starter Kit | ||
|
|
||
| This folder is a low-budget workflow to get from first run to a valid non-record PR. | ||
|
|
||
| ## 1) Fork + set your remote | ||
|
|
||
| From your local repo root: | ||
|
|
||
| ```bash | ||
| git remote rename origin upstream | ||
| git remote add origin https://github.com/YOUR_GITHUB_USERNAME/parameter-golf.git | ||
| git fetch upstream | ||
| git checkout -b exp/first-runs upstream/main | ||
| git push -u origin exp/first-runs | ||
| ``` | ||
|
|
||
| ## 2) On RunPod: first smoke run | ||
|
|
||
| Use scripts in `starter_kit/scripts`: | ||
|
|
||
| 1. `01_runpod_bootstrap.sh` | ||
| 2. `02_smoke_run.sh` | ||
|
|
||
| ## 3) Promote to serious run | ||
|
|
||
| Run `03_full_run.sh` once smoke logs look healthy. | ||
|
|
||
| ## 4) Prepare a PR-ready records folder | ||
|
|
||
| Run: | ||
|
|
||
| ```bash | ||
| python starter_kit/scripts/prepare_submission.py \ | ||
| --track non_record_16mb \ | ||
| --run-name my_first_non_record \ | ||
| --author-name "Your Name" \ | ||
| --github-id "your_github" \ | ||
| --val-bpb 1.1999 | ||
| ``` | ||
|
|
||
| Then copy your real train log into the generated folder and edit README details. | ||
|
|
||
| ## 5) Submission checklist | ||
|
|
||
| - Folder only adds one new path under `records/track_non_record_16mb/` or `records/track_10min_16mb/`. | ||
| - Includes `README.md`, `submission.json`, `train_gpt.py`, and train log. | ||
| - Repro steps are explicit and complete. | ||
| - No validation-data leakage or rule violations. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Experiment Log Template | ||
|
|
||
| ## Run Metadata | ||
|
|
||
| - run_id: | ||
| - date: | ||
| - gpu: | ||
| - cost_estimate_usd: | ||
| - dataset_variant: | ||
| - train_shards: | ||
| - max_wallclock_seconds: | ||
|
|
||
| ## Config Delta | ||
|
|
||
| - base_commit: | ||
| - branch: | ||
| - changed_hparams: | ||
| - changed_code_paths: | ||
|
|
||
| ## Outcomes | ||
|
|
||
| - val_loss: | ||
| - val_bpb: | ||
| - final_int8_zlib_roundtrip_bytes: | ||
| - step_count: | ||
| - runtime_seconds: | ||
|
|
||
| ## Decision | ||
|
|
||
| - keep / drop: | ||
| - reason: | ||
| - next test: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| # Usage: | ||
| # bash starter_kit/scripts/01_runpod_bootstrap.sh https://github.com/YOUR_GITHUB_USERNAME/parameter-golf.git | ||
|
|
||
| FORK_URL="${1:-}" | ||
| if [[ -z "$FORK_URL" ]]; then | ||
| echo "Provide your fork URL as first arg." | ||
| exit 1 | ||
| fi | ||
|
|
||
| cd /workspace | ||
| if [[ ! -d parameter-golf ]]; then | ||
| git clone "$FORK_URL" parameter-golf | ||
| fi | ||
|
|
||
| cd parameter-golf | ||
| git remote -v | ||
|
|
||
| echo "Downloading small dataset slice for low-cost iteration..." | ||
| python3 data/cached_challenge_fineweb.py --variant sp1024 --train-shards 1 | ||
|
|
||
| echo "Bootstrap complete. Run: bash starter_kit/scripts/02_smoke_run.sh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| # Quick low-cost run (~4 minutes max) | ||
| cd /workspace/parameter-golf | ||
|
|
||
| RUN_ID="${RUN_ID:-smoke_sp1024_$(date +%Y%m%d_%H%M%S)}" | ||
| export RUN_ID | ||
| export DATA_PATH=./data/datasets/fineweb10B_sp1024/ | ||
| export TOKENIZER_PATH=./data/tokenizers/fineweb_1024_bpe.model | ||
| export VOCAB_SIZE=1024 | ||
| export MAX_WALLCLOCK_SECONDS=240 | ||
| export VAL_LOSS_EVERY=0 | ||
|
|
||
| mkdir -p logs | ||
|
|
||
| torchrun --standalone --nproc_per_node=1 train_gpt.py | tee "logs/${RUN_ID}.log" | ||
|
|
||
| echo "Smoke run done: logs/${RUN_ID}.log" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| # Full baseline-style run (~10 minutes) | ||
| cd /workspace/parameter-golf | ||
|
|
||
| RUN_ID="${RUN_ID:-full_sp1024_$(date +%Y%m%d_%H%M%S)}" | ||
| export RUN_ID | ||
| export DATA_PATH=./data/datasets/fineweb10B_sp1024/ | ||
| export TOKENIZER_PATH=./data/tokenizers/fineweb_1024_bpe.model | ||
| export VOCAB_SIZE=1024 | ||
| export MAX_WALLCLOCK_SECONDS=600 | ||
| export VAL_LOSS_EVERY=200 | ||
|
|
||
| mkdir -p logs | ||
|
|
||
| torchrun --standalone --nproc_per_node=1 train_gpt.py | tee "logs/${RUN_ID}.log" | ||
|
|
||
| echo "Full run done: logs/${RUN_ID}.log" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| #!/usr/bin/env python3 | ||
| import argparse | ||
| import datetime as dt | ||
| import json | ||
| import re | ||
| from pathlib import Path | ||
| import shutil | ||
|
|
||
|
|
||
| def main() -> None: | ||
| parser = argparse.ArgumentParser(description="Create a PR-ready records folder.") | ||
| parser.add_argument("--track", choices=["10min_16mb", "non_record_16mb"], required=True) | ||
| parser.add_argument("--run-name", required=True) | ||
| parser.add_argument("--author-name", required=True) | ||
| parser.add_argument("--github-id", required=True) | ||
| parser.add_argument("--val-bpb", type=float, required=True) | ||
| parser.add_argument("--source-train-script", default="train_gpt.py") | ||
| args = parser.parse_args() | ||
|
|
||
| repo_root = Path(__file__).resolve().parents[2] | ||
| date = dt.datetime.now().strftime("%Y-%m-%d") | ||
| # Ensure run name is safe for use as a single path component. | ||
| safe_run_name = re.sub(r"[^A-Za-z0-9._-]", "_", args.run_name).strip("._") | ||
| if not safe_run_name: | ||
| safe_run_name = "run" | ||
| slug = f"{date}_{safe_run_name}" | ||
|
|
||
| if args.track == "10min_16mb": | ||
| track_dir = repo_root / "records" / "track_10min_16mb" | ||
| else: | ||
| track_dir = repo_root / "records" / "track_non_record_16mb" | ||
|
|
||
| out_dir = track_dir / slug | ||
| # Prevent path traversal by enforcing final location under selected track dir. | ||
| if track_dir.resolve() not in out_dir.resolve().parents: | ||
| raise ValueError(f"Unsafe output path resolved outside track dir: {out_dir}") | ||
| out_dir.mkdir(parents=True, exist_ok=False) | ||
|
|
||
| template_dir = repo_root / "starter_kit" / "templates" | ||
| readme_tpl = (template_dir / "README_submission_template.md").read_text(encoding="utf-8") | ||
| readme = ( | ||
| readme_tpl | ||
| .replace("{{RUN_NAME}}", safe_run_name) | ||
| .replace("{{DATE}}", date) | ||
| .replace("{{TRACK}}", args.track) | ||
| .replace("{{AUTHOR_NAME}}", args.author_name) | ||
| .replace("{{GITHUB_ID}}", args.github_id) | ||
| .replace("{{VAL_BPB}}", f"{args.val_bpb:.4f}") | ||
| ) | ||
| (out_dir / "README.md").write_text(readme, encoding="utf-8") | ||
|
|
||
| submission = { | ||
| "author": args.author_name, | ||
| "name": safe_run_name, | ||
| "blurb": "Fill out details and attach train logs.", | ||
SID-6921 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "size": "16mb", | ||
| "github_id": args.github_id, | ||
| "track": args.track, | ||
| "val_bpb": round(args.val_bpb, 4), | ||
| "date": date | ||
| } | ||
SID-6921 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| (out_dir / "submission.json").write_text(json.dumps(submission, indent=2) + "\n", encoding="utf-8") | ||
|
|
||
| source_script = repo_root / args.source_train_script | ||
SID-6921 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if not source_script.exists(): | ||
| raise FileNotFoundError(f"Could not find train script: {source_script}") | ||
| shutil.copy2(source_script, out_dir / "train_gpt.py") | ||
|
|
||
| (out_dir / "train.log").write_text("# Paste or copy real run logs here\n", encoding="utf-8") | ||
|
|
||
| print(f"Created: {out_dir}") | ||
| print("Next: copy your actual log into train.log and complete README details.") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # {{RUN_NAME}} | ||
|
|
||
| - Date: {{DATE}} | ||
| - Track: {{TRACK}} | ||
| - Author: {{AUTHOR_NAME}} ({{GITHUB_ID}}) | ||
| - Reported val_bpb: {{VAL_BPB}} | ||
|
|
||
| ## Summary | ||
|
|
||
| Short summary of the idea and why it may help. | ||
|
|
||
| ## What Changed | ||
|
|
||
| - List architecture changes. | ||
| - List optimization and schedule changes. | ||
| - List quantization or eval changes. | ||
|
|
||
| ## Repro Command | ||
|
|
||
| ```bash | ||
| RUN_ID={{RUN_NAME}} \ | ||
| DATA_PATH=./data/datasets/fineweb10B_sp1024/ \ | ||
| TOKENIZER_PATH=./data/tokenizers/fineweb_1024_bpe.model \ | ||
| VOCAB_SIZE=1024 \ | ||
| torchrun --standalone --nproc_per_node=1 train_gpt.py | ||
| ``` | ||
|
|
||
| ## Results | ||
|
|
||
| - val_bpb: | ||
| - val_loss: | ||
| - compressed_bytes: | ||
| - wallclock_seconds: | ||
|
|
||
| ## Notes | ||
|
|
||
| Any caveats, negative findings, or follow-up experiments. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "author": "Your Name", | ||
| "name": "your_run_name", | ||
| "blurb": "Fill with concise methodology and constraints.", | ||
| "size": "16mb", | ||
SID-6921 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "github_id": "your_github", | ||
| "track": "non_record_16mb", | ||
| "val_bpb": 1.2000, | ||
| "date": "YYYY-MM-DD", | ||
| "seed": 1337 | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.