Repository navigation
Add opt-in Qwen/Gemma checkpointing, disk offload and streaming backward - #11
Merged
Merged
Conversation
…ing backward Keep default training paths and GPT-2 unchanged. Include primitive/model/CLI regression tests, installation support, and explicit numerical limitations.
…ependency is missing
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Publish the locally developed memory paths through the current public API, rather than replacing the repository with the local training tree.
All three model switches default to off. GPT-2 fixes are deliberately excluded. This does not include or merge #6 / #7, change published experiment results, or upload models/data/binaries.
Validation
macOS arm64, Apple Clang; no phone/CUDA training claim:
Important numerical and resource limits
Streaming is not bitwise-equivalent to dense/GEMM attention. In the real Qwen two-update diagnostic, three of 540,672 adapter coordinates exceed the original absolute 2e-5 comparison limit; maximum difference is 6.54949e-5. That strict check remains a failure, not a claimed pass. At the worst first-step coordinate, saved Adam moments reproduce the amplification of near-zero FP32 gradient differences with unchanged epsilon=1e-8. This evidence does not establish equal long-run task accuracy.
The docs disclose this result and recommend standard attention when strict historical adapter reproduction is required. No optimizer settings were changed to make the check pass.
Other limits: CPU FP32, deterministic first-order checkpoint regions, no RNG replay / attention dropout / softcapping / mask gradients; legacy autograd keeps the standard-attention training fallback. Offload budget is not a process RSS cap; saved tensors/external aliases can retain storage, and OS caching means payload bytes are not physical disk I/O. No saving percentage or speedup is claimed. Real Gemma 1B and mobile-device training are not validated in this PR.
Reproduce
cmake -S operator -B build -DCMAKE_BUILD_TYPE=Release -DUSE_BLAS=ON -DBUILD_TESTS=ON cmake --build build -j 4 ctest --test-dir build --output-on-failure # Also run with -DUSE_BLAS=OFF in a separate build directory.See
docs/MEMORY_OPTIMIZATIONS.mdfor model/CLI commands anddocs/MEMORY_OPTIMIZATION_VALIDATION.mdfor numerical scope. The current-main base is086b1a0; unrelated existing files are preserved.Release integration follow-up
The first Actions run rejected the historical
operator/opt_opsdirectory and exposed a missing ripgrep dependency in release auditing. The sharder now lives under the publicoperator/finetune_ops/memorypath; the release blacklist is unchanged. CI installs ripgrep when missing, and the audit fails explicitly if it is unavailable. Rebuilt BLAS/noBLAS, WERROR, sanitizer, legacy and clean installed-consumer checks pass after relocation. No training arithmetic was changed by the follow-up. Remote Actions validates the complete release tree.Final CI status
Both push and pull-request Actions completed successfully on
ffbc47a249701fdf9ad100817f1ad3ab672cd814. The PR workflow passed release auditing, WERROR build/CTest, both package consumers, Android visualizer build, all five existing training smoke runs and energy scheduler integration. The numerical limitations above are unchanged; a green build is not a claim of long-run accuracy equivalence.