Repository navigation
Train a random-init six-layer BERT-style MLM with native TorchTPU - #178
Draft
charlesmartin14 wants to merge 3 commits into
Draft
charlesmartin14 wants to merge 3 commits into
charlesmartin14 wants to merge 3 commits into
Conversation
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.
The existing DistilBERT experiment fine-tunes pretrained weights with PyTorch/XLA. This independent folder adds random-initialization MLM pretraining on native TorchTPU so we can measure spectra that emerge during training.
The experiment is labeled BERT-6 MLM from scratch: the stock six-layer DistilBERT architecture (66,985,530 parameters), trained without a teacher or distillation loss. It uses TorchTPU 0.2.0, tpu_dist, eight workers, AdamW, pinned WikiText-103 data/tokenizer, checkpoint/restart, and CPU WeightWatcher fits on all 36 encoder matrices. Full best-validation weights are retained separately, and evaluation masks remain fixed when training masking changes.
A second complete code audit found additional launch and recovery failures and fixes them here:
The Cloud Shell launcher reuses the existing idle leased v5e-8 in tpu-builders-504820, checks occupancy and persistent storage, creates a separate Python 3.12+ environment, probes eight ranks, executes two real updates, then resumes the same model. It caps execution at the existing lease and the 5.5-hour default budget. Each invocation runs one committed configuration; the six-point LR/warmup grid is available without an automatic sweep.
Validation: 19 CPU engineering tests passed; one live Gloo test was skipped because this environment previously rejected socket/interface initialization. Coverage includes exact parameters, optimizer state and evaluation metrics after restart for AdamW, Adam and SGD; compiled aot_eager BF16 restart with dropout; global masked-token gradient arithmetic; full architecture; fixed evaluation masks; and injected interruption/cleanup scenarios. After the final retention-filter extension, both focused checkpoint regression tests passed again. VALIDATION.json records the tested source hashes and exact scope. Complete real WikiText preparation was previously verified: 913,341 training, 1,913 validation and 2,191 test sequences, with every row and hash checked; preparation code is unchanged.
Hardware status: no TPU model has been launched or trained from this session. API-selection tests use mocks; native TPU kernel coverage, distributed execution, RNG replay, restart, throughput, convergence and alpha outcomes remain pending. The 10,000-update pilot covers about 2.803 corpus passes. It and the six-layer architecture are defensible starting points, not established optima; AUDIT.md records the primary literature and calibration requirements. Select recipes using validation quality, with alpha remaining an observed outcome.