Repository navigation
Document NanoGPT optimizations and benchmark evidence - #304
cromwellian wants to merge 3 commits into
Conversation
Report setup, plan reuse, shared execution, compact storage and GPU-resident training with measured startup, per-step and memory results. Keep historical workloads and validation scope distinct, retain reproducible comparison/profiling harnesses and curated text evidence, and exclude checkpoints and scratch output. Co-Authored-By: GPT-6 <noreply@openai.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Record the independent evidence PR, cross-repository dependencies and publication source pins. Co-Authored-By: GPT-6 <noreply@openai.com>
Retain the 714-test downstream and 128-test binding logs and final source pins. Co-Authored-By: GPT-6 <noreply@openai.com>
|
🌀 Claude: Thank you. The report is a model of honest benchmarking: it never multiplies ratios from different workloads, it separates first-step from warm times, and it says plainly what wasn't isolated or didn't complete. It's very valuable to have. Concern: size. The PR adds 23,587 lines in 180 files, nearly all of it raw logs, CSVs and JSON under
Smaller points
#307 discusses where the code this report describes should live. |
🛠️ Codex Repeated training calls can prepare a SQL grad/VJP/JVP statement once with `Context.prepare` and write new Dataset values into existing input buffers. Fine-chunk registration counts partitions arithmetically and registers Arrow batches directly; extension handles retain Dataset metadata and invalidation state. `Context(threads=...)` exposes target parallel partitions. This independently useful change starts the NanoGPT optimization stack; shared/compact execution, resident training and the evidence report follow separately. Apple M5 Ultra measurements: one-cell-chunk registration 31.372→0.405 ms (77.44× for that specific case), update-and-sum 2.769→1.027 ms (2.70×), repeated-CTE preparation 1.709→1.307 ms (1.31×). Tiny-model warm time improved 1.11×, but its five-step total regressed due to setup; this does not claim universally faster startup. Validation: 47 focused AD/preparation tests passed, covering current inputs, changing join-key ranges, old-result snapshots, coordinate rejection and shared Context invalidation. The complete downstream stack passed 714 non-integration tests. Changed Python files pass Ruff. Review order: this PR → #302 (shared kernels) → #303 (compact arrays) → #305 (resident training). #304 contains the separate consolidated report and evidence. Closes #294 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Prepared queries now support gradient, vector-Jacobian product, and Jacobian-vector product operations, including repeated execution after registered table data is updated or re-registered. * Added an option to configure the number of query threads. * Added support for creating contexts with extensions. * **Bug Fixes** * Improved prepared-query results when join-key values change and when datasets are registered in smaller chunks. * Improved in-memory partitioning for datasets. * **Documentation** * Clarified that prepared queries retain programs for repeated execution. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Ray <cromwellian@Rays-Mac-Studio.local> Co-authored-by: GPT-6 <noreply@openai.com> Co-authored-by: Alex Merose <al@merose.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
🛠️ Codex
Add
NANOGPT_PERFORMANCE.mdas the consolidated record of CPU setup, plan reuse, shared CTE execution, compact arrays, native kernels and complete GPU-resident training. It explains each change, its motivation and measured startup/per-step/memory effects, with explicit limits where contributions were not isolated or runs were incomplete.Keep tiny SGD, 123M/124M synthetic vocabulary, real 10.7M-character AdamW and native-framework comparisons separate. The latest resident recipe measures 101.3 ms per warm step over 100 updates (19.98× over the earlier Arrow GPU path), still 3.76× slower than native PyTorch MPS. This is training from scratch, not inference. Startup/cache variation and remaining scalar synchronization are disclosed.
Retain comparison/profiling harnesses and curated text evidence, including the checked five-step run, 100-step memory/copy counters, native MPS results and the 714-test publication log. Exclude model checkpoints, binary profiles and scratch output.
summarize_resident.pyrecomputes the headline ratios. Generated CSV/log whitespace is normalized without changing numerical records.This documentation/evidence PR is independent of the code branches so its default diff stays focused. API links/harnesses describe the companion CPU/shared/compact/resident contributions and should land with or after them. Each dependency repository carries its own
OPTIMIZATION.md; cross-repository dependencies and incremental review links are documented in the code PRs.Validation: report-local links resolve in the complete checkout; summary ratios were regenerated from recorded metrics; changed Python files pass Ruff and the staged diff passes whitespace checks. Performance records retain their original source/build provenance rather than claiming every historical run used the publication commit.
Code review order: #301 → #302 → #303 → #305. Companion dependencies: ddx #256/#257 and EinFold #156/#157. The report includes a complete dependency table.