Slayer1B 1.09: update cards and training files
Browse files- DATA_CARD.md +22 -20
- README.md +36 -19
- TRAINING_CONFIGURATION.md +46 -21
- hf_do_ckpt.py +108 -0
- uruchom_109.sh +28 -14
DATA_CARD.md
CHANGED
|
@@ -7,51 +7,53 @@ task_categories:
|
|
| 7 |
- text-generation
|
| 8 |
tags:
|
| 9 |
- pretraining
|
| 10 |
-
- training-
|
| 11 |
---
|
| 12 |
|
| 13 |
# Slayer1B 1.09 — staged training data
|
| 14 |
|
| 15 |
**Arkadiusz Słota, Anna Sieczka, Piotr Styła / Fabryka AI (SlayerLab)**
|
| 16 |
|
| 17 |
-
**
|
| 18 |
|
| 19 |
## Target, units and exposure
|
| 20 |
|
| 21 |
-
The
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
-
The
|
| 26 |
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
|---|---:|---|
|
| 29 |
-
| s01 v2;
|
| 30 |
-
| s02;
|
| 31 |
-
| s03;
|
| 32 |
|
| 33 |
-
Their
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
## Proposed source catalog
|
| 38 |
|
| 39 |
-
The
|
| 40 |
|
| 41 |
Linked public cards describe upstream material, not approval of every document:
|
| 42 |
|
| 43 |
| Candidate | Published unit / selection condition |
|
| 44 |
|---|---|
|
| 45 |
-
| [GoLLeM PL](https://huggingface.co/datasets/SlayerLab/gollem-corpus-16b-pl), `17f9d37a` |
|
| 46 |
-
| [FinePDFs-Edu](https://huggingface.co/datasets/HuggingFaceFW/finepdfs-edu), `9cfabe21`, PL/EN |
|
| 47 |
-
| [PL Logika](https://huggingface.co/datasets/SlayerLab/slayer-pl-logika-2b), `e24c8b71` |
|
| 48 |
-
| [English Technical](https://huggingface.co/datasets/SlayerLab/english-technical-1b), `3b833d36`; [1.07 replay](https://huggingface.co/datasets/SlayerLab/slayer-1.07-pretrain), `6a337bbf` |
|
| 49 |
| Common Pile [peS2o](https://huggingface.co/datasets/common-pile/peS2o_filtered), [PubMed](https://huggingface.co/datasets/common-pile/pubmed_filtered), [arXiv](https://huggingface.co/datasets/common-pile/arxiv_papers_filtered) | Published text sizes: 182.6/147.1/19 UTF-8 GB; per-document open-license allowlist, not blanket permission |
|
| 50 |
| Common Pile [StackExchange](https://huggingface.co/datasets/common-pile/stackexchange_filtered), [Wikimedia](https://huggingface.co/datasets/common-pile/wikimedia_filtered) | 89.7/57.4 UTF-8 GB; preserve attribution and applicable CC BY-SA terms |
|
| 51 |
| Common Pile [DOAB](https://huggingface.co/datasets/common-pile/doab_filtered), [PressBooks](https://huggingface.co/datasets/common-pile/pressbooks_filtered), [LibreTexts](https://huggingface.co/datasets/common-pile/libretexts_filtered), [OERCommons](https://huggingface.co/datasets/common-pile/oercommons_filtered) | 12/0.6/3.6/0.05 UTF-8 GB; per-document licensing; exclude LibreTexts GFDL material |
|
| 52 |
| [FineMath](https://huggingface.co/datasets/HuggingFaceTB/finemath), [FineWeb-Edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu) | FineMath-4+ reports 9.6B Llama tokens; FineWeb-Edu samples use GPT-2; ODC-By plus Common Crawl terms |
|
| 53 |
|
| 54 |
-
|
| 55 |
|
| 56 |
## Admission, isolation and byte approval
|
| 57 |
|
|
@@ -59,10 +61,10 @@ Use a per-document allowlist: CC0/public domain, eligible CC BY/CC BY-SA, ODC-By
|
|
| 59 |
|
| 60 |
For new material reserve 1% of documents per group **before TRAIN/sharding**, grouping source-book identities; this is not 1% of tokens. Preserve existing evaluation partitions. Apply exact/near-deduplication and 13-gram plus 8-gram-template decontamination with positive controls, including GSM8K/MATH/ARC/panels.
|
| 61 |
|
| 62 |
-
|
| 63 |
|
| 64 |
-
GoLLeM reports LLMzSzŁ variants for 1,662/18,820 items (8.83%); exclude affected items if evaluated. Its card conflicts about PoQuAD exclusion versus partition inclusion: do not use PoQuAD without decontamination. The
|
| 65 |
|
| 66 |
Whole-document PII DROP changes coverage; document-drop fraction is not token-loss fraction. Independent residual checks, post-filter document/native-token counts, deduplication losses and final pins remain pending. Identifiers, extraction damage, bias and incorrect reasoning may survive.
|
| 67 |
|
| 68 |
-
|
|
|
|
| 7 |
- text-generation
|
| 8 |
tags:
|
| 9 |
- pretraining
|
| 10 |
+
- training-paused
|
| 11 |
---
|
| 12 |
|
| 13 |
# Slayer1B 1.09 — staged training data
|
| 14 |
|
| 15 |
**Arkadiusz Słota, Anna Sieczka, Piotr Styła / Fabryka AI (SlayerLab)**
|
| 16 |
|
| 17 |
+
**Revised CPT data plan, 9 November 2026; no clean CPT shard byte-approved yet.** The requested model continues 1.08 with diverse new data. The earlier from-scratch attempt is abandoned; its s01–s03 approvals do not make those replay-containing inputs eligible for this continuation. No completed 1.09 exposure, corpus or verified over-100B unique-history total is claimed.
|
| 18 |
|
| 19 |
## Target, units and exposure
|
| 20 |
|
| 21 |
+
The request is to exceed **100B unique tokens after continuation**, with PL/EN recomputed and allowed to differ from the earlier 21.37% target. Report inherited unique-data contribution, retained new-data capacity and actually processed positions separately. Use a declared common tokenizer/unit, including EOS where counted; replay, epochs, old exposure totals, proxy tokenizers and source-language labels cannot establish the unique-history total.
|
| 22 |
|
| 23 |
+
The selected new-source allocation is **20% PL / 80% EN** for a planned 80,000 updates, or **83,886,080,000 new positions**. These are recipe targets, not retained or consumed counts. The inherited language split and verified unique-history contribution remain separate unresolved quantities; an upper estimate of approximately 23B cannot prove the over-100B target.
|
| 24 |
|
| 25 |
+
The abandoned schedule was 95,000 updates × 1,048,576 positions = **99,614,720,000**, not exactly 100B. It is not a newly approved CPT length or a count of distinct data already seen by the starting model.
|
| 26 |
|
| 27 |
+
The earlier random-initialization attempt used s01 v2. The references below are **historical inputs, not approved fresh CPT shards**. s01 contains ancestry data; s02/s03 need replacement Polish inputs and complete ancestral deduplication checks on reusable English material. No consumed language ratio or recovered checkpoint is established by their capacities.
|
| 28 |
+
|
| 29 |
+
| Historical reference, not a clean CPT shard | Input positions | Historical TRAIN SHA256 |
|
| 30 |
|---|---:|---|
|
| 31 |
+
| s01 v2; withdrawn from new CPT inputs | 5,316,374,064 | `2ab70797649947e0c14b8067161ed8a2541585428ca52c5ac8c9a744669bbb06` |
|
| 32 |
+
| s02; rebuild/checks required for CPT | 5,302,913,370 | `b4df1406b88f131ac14a431108e33a68450fbd783a748a4978dc5a99a5886bb3` |
|
| 33 |
+
| s03; rebuild/checks required for CPT | 5,284,760,292 | `b1091fbc7bcb1a677c829dd07b288f18c353c6b923d99dd0a85338deb5f727be` |
|
| 34 |
|
| 35 |
+
Their **15,904,047,726 positions** are historical reference capacity, **not ready fresh CPT data**. Queue `6e06f0979f27c60e524852d89660bb2febef59a8b5f21f846e0618af1235715d` belongs to the abandoned attempt. Its [old Track run](https://track.fabryka.ai/run/08cf77cf-e995-5ee1-b843-05cbb96e4f4b) last received update 450 / 471,859,200 positions; these must not be relabelled as CPT from 1.08. The proper continuation needs a separate history.
|
| 36 |
|
| 37 |
+
The reported ancestry inventory starts 1.00 from random weights, then continues through 1.06 on `slayer-pl-8x3b@d50df04a`, 1.07 on `slayer-1.07-pretrain@6a337bbf`, and 1.08 on R1 TRAIN `b73a69ea` (including Logika and English Technical). The conservative exclusion reference covers the union of these inputs, **not a claim that every reference document was actually trained on**. Known gaps include unavailable shared-history train digests for pack-04–07 and uncertain consumed tails/partial 1.08 coverage. Used-document exclusion, exact token deduplication and normalized-text fingerprints do not prove semantic uniqueness or a lower count of inherited exposure.
|
| 38 |
|
| 39 |
## Proposed source catalog
|
| 40 |
|
| 41 |
+
The fresh PL/EN/domain allocation is being rebuilt from eligible sources and post-filter counts. The earlier 78.63B EN category allocation and fixed 21.37% PL recipe are not the revised mixture. No candidate capacity, extrapolation or conversion is presented as retained fresh data.
|
| 42 |
|
| 43 |
Linked public cards describe upstream material, not approval of every document:
|
| 44 |
|
| 45 |
| Candidate | Published unit / selection condition |
|
| 46 |
|---|---|
|
| 47 |
+
| [GoLLeM PL](https://huggingface.co/datasets/SlayerLab/gollem-corpus-16b-pl), `17f9d37a` | Candidate only after ancestral checks, including HPLT overlap with 1.06/1.07. Published 16.58B V32k / 14.62B web are not fresh retained v6 counts. Web `CC0-1.0` labels HPLT packaging, not text rights; web TDM and curated per-record rights are reviewed separately |
|
| 48 |
+
| [FinePDFs-Edu](https://huggingface.co/datasets/HuggingFaceFW/finepdfs-edu), `9cfabe21`, PL/EN | Candidate requiring measured retained v6 counts, provenance, rights and ancestral overlap checks; ODC-By/Common Crawl terms are not blanket text redistribution rights |
|
| 49 |
+
| [PL Logika](https://huggingface.co/datasets/SlayerLab/slayer-pl-logika-2b), `e24c8b71` | Previously used by 1.08: reference for exclusion and existing evaluations, **not fresh CPT training input** |
|
| 50 |
+
| [English Technical](https://huggingface.co/datasets/SlayerLab/english-technical-1b), `3b833d36`; [1.07 replay](https://huggingface.co/datasets/SlayerLab/slayer-1.07-pretrain), `6a337bbf` | Previously seen ancestry material: deduplication references, not eligible novel training capacity |
|
| 51 |
| Common Pile [peS2o](https://huggingface.co/datasets/common-pile/peS2o_filtered), [PubMed](https://huggingface.co/datasets/common-pile/pubmed_filtered), [arXiv](https://huggingface.co/datasets/common-pile/arxiv_papers_filtered) | Published text sizes: 182.6/147.1/19 UTF-8 GB; per-document open-license allowlist, not blanket permission |
|
| 52 |
| Common Pile [StackExchange](https://huggingface.co/datasets/common-pile/stackexchange_filtered), [Wikimedia](https://huggingface.co/datasets/common-pile/wikimedia_filtered) | 89.7/57.4 UTF-8 GB; preserve attribution and applicable CC BY-SA terms |
|
| 53 |
| Common Pile [DOAB](https://huggingface.co/datasets/common-pile/doab_filtered), [PressBooks](https://huggingface.co/datasets/common-pile/pressbooks_filtered), [LibreTexts](https://huggingface.co/datasets/common-pile/libretexts_filtered), [OERCommons](https://huggingface.co/datasets/common-pile/oercommons_filtered) | 12/0.6/3.6/0.05 UTF-8 GB; per-document licensing; exclude LibreTexts GFDL material |
|
| 54 |
| [FineMath](https://huggingface.co/datasets/HuggingFaceTB/finemath), [FineWeb-Edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu) | FineMath-4+ reports 9.6B Llama tokens; FineWeb-Edu samples use GPT-2; ODC-By plus Common Crawl terms |
|
| 55 |
|
| 56 |
+
Additional candidates include FineWeb2-HQ-Plus and other separately approved diverse sources; none supplies a verified retained amount or final PL share by its name alone. Replay from 1.07 is not a reserve of new data. peS2o's card says `metadata.license`, while the inventory identifies `metadata.oa_license`; use the actual pinned schema.
|
| 57 |
|
| 58 |
## Admission, isolation and byte approval
|
| 59 |
|
|
|
|
| 61 |
|
| 62 |
For new material reserve 1% of documents per group **before TRAIN/sharding**, grouping source-book identities; this is not 1% of tokens. Preserve existing evaluation partitions. Apply exact/near-deduplication and 13-gram plus 8-gram-template decontamination with positive controls, including GSM8K/MATH/ARC/panels.
|
| 63 |
|
| 64 |
+
The old s01 training exception does **not** authorize replay in this revised CPT. Retrospective scans of the inherited training history against later benchmarks must report hit items and evaluation exclusions for the compared models; they cannot remove already learned exposure. New benchmarks remain descriptive until those checks are complete.
|
| 65 |
|
| 66 |
+
GoLLeM reports LLMzSzŁ variants for 1,662/18,820 items (8.83%); exclude affected items if evaluated. Its card conflicts about PoQuAD exclusion versus partition inclusion: do not use PoQuAD without decontamination. The ancestry's reported near-deduplication and EWoK omissions remain inherited concerns; filtering new data does not erase them from the starting weights.
|
| 67 |
|
| 68 |
Whole-document PII DROP changes coverage; document-drop fraction is not token-loss fraction. Independent residual checks, post-filter document/native-token counts, deduplication losses and final pins remain pending. Identifiers, extraction damage, bias and incorrect reasoning may survive.
|
| 69 |
|
| 70 |
+
Content/code approval is **not byte approval**. The revised CPT currently has **zero byte-approved complete fresh shards**; old s01 SHA256 `2ab70797649947e0c14b8067161ed8a2541585428ca52c5ac8c9a744669bbb06` is historical, not approval for its reuse. Each new tranche needs its own config, byte-derived digests, manifest and sampler identity. Tokenizer v6 SHA256 remains `0640d3bd3674d7a6e59c540d945a2ad275a12e1bcaeb6007c37a90751f9815dd`. Rights, attribution and egress are separate publication conditions.
|
README.md
CHANGED
|
@@ -8,30 +8,43 @@ tags:
|
|
| 8 |
- polish
|
| 9 |
- causal-lm
|
| 10 |
- pretraining
|
| 11 |
-
-
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
# Slayer1B 1.09
|
| 15 |
|
| 16 |
**Arkadiusz Słota, Anna Sieczka, Piotr Styła / Fabryka AI (SlayerLab)**
|
| 17 |
|
| 18 |
-
**
|
| 19 |
|
| 20 |
## Objective and starting point
|
| 21 |
|
| 22 |
-
The
|
| 23 |
|
| 24 |
-
The
|
| 25 |
|
| 26 |
The unchanged architecture is specified as **1,073,912,851 parameters**, 20 layers, width 2,048, 16 heads, SwiGLU, RMSNorm, RoPE base 500,000, QK normalization and value residuals. The reused v6 tokenizer has vocabulary 32,768 and pin `0640d3bd3674d7a6e59c540d945a2ad275a12e1bcaeb6007c37a90751f9815dd`.
|
| 27 |
|
| 28 |
-
Architecture and tokenizer lineage
|
| 29 |
|
| 30 |
-
The [training configuration](TRAINING_CONFIGURATION.md)
|
| 31 |
|
| 32 |
-
##
|
| 33 |
|
| 34 |
-
| Setting |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|---|---|
|
| 36 |
| Trainer / optimizer | Existing r24.2; Muon with AdamW; fresh optimizer |
|
| 37 |
| Batch / context | 256 × 4,096 = 1,048,576 positions per update |
|
|
@@ -40,34 +53,38 @@ The [training configuration](TRAINING_CONFIGURATION.md) identifies exact code di
|
|
| 40 |
| WSD | 2,000 warmup updates; constant LR 0.0006, Muon 0.02; final 20% uses 1−sqrt decay to nonzero LR floor 0.00006 |
|
| 41 |
| Checkpoints | Every 500 updates and retained slot-end milestones |
|
| 42 |
|
| 43 |
-
**95,000 × 1,048,576 = 99,614,720,000 positions
|
| 44 |
|
| 45 |
-
|
| 46 |
|
| 47 |
-
##
|
| 48 |
|
| 49 |
The [public Track run](https://track.fabryka.ai/run/08cf77cf-e995-5ee1-b843-05cbb96e4f4b) is separate from 1.08. At update 30 it records training loss **10.3959**, interval throughput **576,593 positions/s** and **31,457,280 processed positions** (30 × 1,048,576). This is an early interval, not end-to-end billed throughput or a quality evaluation. The first slot targets 5,000 updates; its completion is not claimed.
|
| 50 |
|
| 51 |
-
The
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
## Data and exposure
|
| 54 |
|
| 55 |
-
|
| 56 |
|
| 57 |
-
The
|
| 58 |
|
| 59 |
-
New material requires
|
| 60 |
|
| 61 |
## Evaluation and acceptance
|
| 62 |
|
| 63 |
-
|
| 64 |
|
| 65 |
-
|
| 66 |
|
| 67 |
Comparison is descriptive: no replay-only control is budgeted, and initialization, exposure and schedule differ. No causal dataset benefit or multi-seed significance can be claimed.
|
| 68 |
|
| 69 |
## Cost, licensing and limitations
|
| 70 |
|
| 71 |
-
|
| 72 |
|
| 73 |
-
1.
|
|
|
|
| 8 |
- polish
|
| 9 |
- causal-lm
|
| 10 |
- pretraining
|
| 11 |
+
- continued-pretraining
|
| 12 |
+
- training-paused
|
| 13 |
---
|
| 14 |
|
| 15 |
# Slayer1B 1.09
|
| 16 |
|
| 17 |
**Arkadiusz Słota, Anna Sieczka, Piotr Styła / Fabryka AI (SlayerLab)**
|
| 18 |
|
| 19 |
+
**Corrected plan: continued pretraining from 1.08; not started.** The 9 November 2026 decision at 23:23–23:24 UTC supersedes the earlier from-scratch interpretation. That initial attempt was interrupted and abandoned; it is not the intended 1.09 continuation. No completed 1.09 model, recovered checkpoint, new quality results or inference-ready weight release is claimed.
|
| 20 |
|
| 21 |
## Objective and starting point
|
| 22 |
|
| 23 |
+
The requested 1.09 continues the existing 1B model with **diverse, new, deduplicated data**, aiming for **more than 100B unique tokens after continuation**. The inherited unique-data contribution, additional exposure needed and PL/EN balance must be recomputed; neither replayed training exposure nor the old 95,000-update default proves this target. The earlier fixed 21.37% addition is no longer a requirement. The deadline and approved budget remain constraints, not achieved results.
|
| 24 |
|
| 25 |
+
The intended starting weights are **[SlayerLab/Slayer1B-1.08](https://huggingface.co/SlayerLab/Slayer1B-1.08/tree/5f854a0cc7160594d54d1788d37a44e8ebabe16c)**, not random initialization and not the abandoned attempt's checkpoint. The selected v5 launcher explicitly initializes those weights with fresh optimizer state and a new output history. Its code review is complete; clean-data bytes, hardware control and actual execution remain prerequisites.
|
| 26 |
|
| 27 |
The unchanged architecture is specified as **1,073,912,851 parameters**, 20 layers, width 2,048, 16 heads, SwiGLU, RMSNorm, RoPE base 500,000, QK normalization and value residuals. The reused v6 tokenizer has vocabulary 32,768 and pin `0640d3bd3674d7a6e59c540d945a2ad275a12e1bcaeb6007c37a90751f9815dd`.
|
| 28 |
|
| 29 |
+
Architecture and tokenizer lineage includes [SlayerLab/Slayer1B-1.07](https://huggingface.co/SlayerLab/Slayer1B-1.07/blob/a090b54e658fb57dc5166c1fcc90cc6bf5c80106/README.md). The selected 1.08 base was published as an experiment with an **ARC-Easy retention-guard FAIL**; choosing it for further training does not erase that verdict or establish a successful 1.09.
|
| 30 |
|
| 31 |
+
The [training configuration](TRAINING_CONFIGURATION.md) preserves exact evidence for completed 1.08 and the abandoned first attempt, explicitly separated from the revised CPT plan.
|
| 32 |
|
| 33 |
+
## Selected CPT plan — reviewed, not executed
|
| 34 |
|
| 35 |
+
| Setting | Operator-selected plan |
|
| 36 |
+
|---|---|
|
| 37 |
+
| New training | 80,000 updates × 1,048,576 = **83,886,080,000 positions**, sixteen 5,000-update slots |
|
| 38 |
+
| New-source allocation | **20% PL / 80% EN target**; not a measured cumulative model-language ratio |
|
| 39 |
+
| Optimizer / schedule | Muon 0.02 plus AdamW peak 0.0006; 2,000-update warmup; final 20% WSD decay to 0.00006 |
|
| 40 |
+
| Checkpoints | Full state every 200 updates; slot-end weight milestones; local workstation copies |
|
| 41 |
+
| Code | Launcher v5 SHA256 `796c71016c1e167bfd3ca98b78518f91c3502a96eac233dd7186ef6639fcc656`; exact command and converter pins in the configuration document |
|
| 42 |
+
|
| 43 |
+
The reported inherited approximately 23B is an **upper estimate**, useful for conservative exclusion of previously seen data, not a verified lower count. Even if all planned new positions are unique and processed once, exceeding 100B requires supported inherited exposure **above 16,113,920,000 unique positions**. Approximately 107B is therefore a conditional estimate, not an established result.
|
| 44 |
+
|
| 45 |
+
## Archived from-scratch attempt — not the CPT recipe
|
| 46 |
+
|
| 47 |
+
| Setting | Abandoned first-attempt configuration |
|
| 48 |
|---|---|
|
| 49 |
| Trainer / optimizer | Existing r24.2; Muon with AdamW; fresh optimizer |
|
| 50 |
| Batch / context | 256 × 4,096 = 1,048,576 positions per update |
|
|
|
|
| 53 |
| WSD | 2,000 warmup updates; constant LR 0.0006, Muon 0.02; final 20% uses 1−sqrt decay to nonzero LR floor 0.00006 |
|
| 54 |
| Checkpoints | Every 500 updates and retained slot-end milestones |
|
| 55 |
|
| 56 |
+
The abandoned plan's **95,000 × 1,048,576 = 99,614,720,000 positions** was not exactly 100B and is **not the approved length of the revised continuation**. Its nineteen planned 5,000-update slots are historical configuration, not a measured unique-history count or evidence that those updates completed.
|
| 57 |
|
| 58 |
+
Slot-1 GPU execution was observed before the interruption. **Do not resume that from-scratch state as the requested CPT.** The continuation needs a separate output history and Track run; historical points must not be relabelled as training from 1.08. Any future queue still requires approved byte ranges, manifest digests and preserved sampler identity within that particular experiment.
|
| 59 |
|
| 60 |
+
## Archived first-attempt evidence — not CPT progress
|
| 61 |
|
| 62 |
The [public Track run](https://track.fabryka.ai/run/08cf77cf-e995-5ee1-b843-05cbb96e4f4b) is separate from 1.08. At update 30 it records training loss **10.3959**, interval throughput **576,593 positions/s** and **31,457,280 processed positions** (30 × 1,048,576). This is an early interval, not end-to-end billed throughput or a quality evaluation. The first slot targets 5,000 updates; its completion is not claimed.
|
| 63 |
|
| 64 |
+
The last received public sample before the pause is update **450**, training loss **4.3910**, with **471,859,200 processed positions**. Its ingestion timestamp is 22:36:50 UTC. It is not a live GPU reading, a final exposure count or proof of a checkpoint at update 500. The trainer's recoverable step must be checked from the saved state, not inferred from elapsed time or the tracker label.
|
| 65 |
+
|
| 66 |
+
Numerical control on the resumed hardware remains pending and is required before the new CPT launch. The earlier permission to start the abandoned slot does not establish that control, approve initialization from 1.08 or approve new data bytes.
|
| 67 |
+
|
| 68 |
+
Checkpoint copies are currently directed to a trusted local workstation, **not Hugging Face**. The retention plan is slot-end weight milestones plus the latest full optimizer checkpoint. That plan does not prove a successful local copy or recovery; publication of documents and code does not imply publication of model weights.
|
| 69 |
|
| 70 |
## Data and exposure
|
| 71 |
|
| 72 |
+
No complete new-data shard is yet byte-approved for CPT from 1.08. Existing s01–s03 references contain already-seen data; their old approvals do not satisfy the revised freshness requirement. Reusable English portions still need the complete ancestry checks, and the Polish portions must be rebuilt; see [the data card](DATA_CARD.md).
|
| 73 |
|
| 74 |
+
The PL/EN balance will follow the approved fresh-data inventory. The user explicitly allows a different ratio; source buckets still do not establish the language share of actually consumed windows. Missing ancestral data must be reported as a limitation, not silently counted as verified unique exposure.
|
| 75 |
|
| 76 |
+
New material requires licensing, PII filtering, contamination scans, grouped held-outs and deduplication against the base model's full data ancestry. A 1% document holdout is not necessarily 1% of tokens. Historical exposure in the starting weights cannot be undone by filtering new inputs; retrospective benchmark hits must be handled explicitly in evaluation denominators.
|
| 77 |
|
| 78 |
## Evaluation and acceptance
|
| 79 |
|
| 80 |
+
The expanded evaluation plan includes 1.07 and 1.08 reference measurements before future 1.09 milestones. Protocols, model/data digests and denominators must accompany published aggregates; the revised continuation's final acceptance protocol must be established before its results are interpreted.
|
| 81 |
|
| 82 |
+
New benchmarks remain **descriptive, contamination check pending** until the retrospective checks are complete. No old threshold, early training-loss decrease or retrospectively chosen checkpoint is presented here as acceptance of the revised continuation.
|
| 83 |
|
| 84 |
Comparison is descriptive: no replay-only control is budgeted, and initialization, exposure and schedule differ. No causal dataset benefit or multi-seed significance can be claimed.
|
| 85 |
|
| 86 |
## Cost, licensing and limitations
|
| 87 |
|
| 88 |
+
The declared 1.09 budget is USD 400, including preparation, restarts and evaluation, not just steady-state training. The additional work needed depends on verified inherited and new unique-data counts; the old 95,000-update plan is not a completed budget calculation. Final expense, sustainable throughput and deadline compliance remain unverified.
|
| 89 |
|
| 90 |
+
The selected 1.08 base declares Apache-2.0; source-text rights and future publication still require separate approval. Privacy filters are heuristic; generated text may be inaccurate, biased, offensive or personal. No reasoning quality, instruction-following ability or professional reliability has been demonstrated for the revised 1.09.
|
TRAINING_CONFIGURATION.md
CHANGED
|
@@ -2,13 +2,44 @@
|
|
| 2 |
|
| 3 |
Fabryka AI / SlayerLab
|
| 4 |
|
| 5 |
-
**1.
|
| 6 |
|
| 7 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
| Component | Identity |
|
| 10 |
|---|---|
|
| 11 |
-
|
|
| 12 |
| First 1.09 launch attempt | `uruchom_109.sh`, SHA256 `dfee11522be49c938f169ca6992cf181f86a3c4e0d26fd5b5fa3646535dc890f` |
|
| 13 |
| Launcher used for observed 1.09 slot 1 | `uruchom_109.sh` v3, SHA256 `c0a2699d1a2d7ce4cddd873ad92ff5ab5bb0dbcecc6e47d6bce01ee9b848895c` |
|
| 14 |
| Saved, actually used 1.08 argument file | SHA256 `d283bcb836e9bb89d5bf7dfa60487055086cf04620ad5c5dd36fe3435f2766a9` |
|
|
@@ -17,9 +48,9 @@ The older public `train_gpt_ref_r23.py` is **not the identity of this training i
|
|
| 17 |
|
| 18 |
The recipes use one eight-GPU B200 node, PyTorch 2.8/CUDA 12.8 and DDP. They are not a four-RTX-4090 configuration. Compute uses bf16 on the verified hardware; `--dtype uint16` below describes **stored token IDs**, not model arithmetic.
|
| 19 |
|
| 20 |
-
##
|
| 21 |
|
| 22 |
-
These arguments occur in the saved 1.08 invocation and the
|
| 23 |
|
| 24 |
```text
|
| 25 |
--batch 256 --grad-accum 4 --block 4096 --dtype uint16 --vocab 32768
|
|
@@ -34,9 +65,9 @@ These arguments occur in the saved 1.08 invocation and the selected 1.09 launche
|
|
| 34 |
|
| 35 |
Global batch is 256 sequences: eight ranks × microbatch 8 × accumulation 4. Activation checkpointing is disabled. Each update processes 1,048,576 token positions. Muon handles matrix parameters; AdamW handles the remaining parameter groups.
|
| 36 |
|
| 37 |
-
##
|
| 38 |
|
| 39 |
-
| Setting | 1.08: saved arguments / completed run | 1.09
|
| 40 |
|---|---|---|
|
| 41 |
| Weight initialization | `--init-from` the public 1.07 weights, fresh optimizer | `START=zero`; no `--init-from` |
|
| 42 |
| Total updates | `--steps 1709` | `--steps 95000` by default |
|
|
@@ -53,27 +84,21 @@ Both argument sets contain `--resume` for automatic recovery. That flag does **n
|
|
| 53 |
|
| 54 |
Output directories, run IDs, data directories, the queue manifest and `--events-jsonl` are operational arguments, not omitted learning choices. For 1.08 they identify `slayer1b_108_r1`; 1.09 uses a separate output history. Do not share output directories between experiments.
|
| 55 |
|
| 56 |
-
##
|
| 57 |
|
| 58 |
-
|
| 59 |
|
| 60 |
-
```bash
|
| 61 |
-
START=zero GPU=B200 S=5000 KROKI=95000 NCCL_P2P_DISABLE=0 \
|
| 62 |
-
D=/workspace/dane109 O=/workspace/runs/109 \
|
| 63 |
-
PY=/workspace/venv/bin/python TORCHRUN=/workspace/venv/bin/torchrun \
|
| 64 |
-
bash /workspace/kod/uruchom_109.sh
|
| 65 |
-
```
|
| 66 |
|
| 67 |
-
|
| 68 |
|
| 69 |
-
|
| 70 |
|
| 71 |
-
Recovery
|
| 72 |
|
| 73 |
-
|
| 74 |
|
| 75 |
## What this does not claim
|
| 76 |
|
| 77 |
-
The 1.08
|
| 78 |
|
| 79 |
-
|
|
|
|
| 2 |
|
| 3 |
Fabryka AI / SlayerLab
|
| 4 |
|
| 5 |
+
**Current intent: 1.09 is continued pretraining from 1.08, not a new from-scratch model.** The user corrected the interpretation on 9 November 2026 at 23:20–23:24 UTC. The v5 recipe below is selected and reviewed, but CPT has not started: clean input bytes and numerical control are still required. Later sections preserve completed 1.08 and the abandoned first attempt separately.
|
| 6 |
|
| 7 |
+
## Required separation for the revised continuation
|
| 8 |
+
|
| 9 |
+
The selected base is [SlayerLab/Slayer1B-1.08 at 5f854a0cc7160594d54d1788d37a44e8ebabe16c](https://huggingface.co/SlayerLab/Slayer1B-1.08/tree/5f854a0cc7160594d54d1788d37a44e8ebabe16c). Use a new output history and Track identity; do not resume the random-initialized attempt or relabel its points as CPT. The launcher pins model SHA256 `1c510d9a59d3b9e62360d1db57e08fa450fb9b09df849df7f2eef132ea6715a4` and config SHA256 `c4c56250100cbb26e1394977ecb613fd41bdb239128592b12a13b30613fa6a94`.
|
| 10 |
+
|
| 11 |
+
The archived v3 invocation reference later in this document is historical evidence only. The reviewed v5 command below is the selected continuation recipe, **not evidence of execution**. Checkpoints are currently destined for the local workstation, not a public weight upload.
|
| 12 |
+
|
| 13 |
+
## Selected v5 CPT command — not yet executed
|
| 14 |
+
|
| 15 |
+
| Component | Pinned identity |
|
| 16 |
+
|---|---|
|
| 17 |
+
| Trainer | `train_gpt_ref_r24_2.py`, SHA256 `46f83b51fcec18ffc3273d80fb9eab29e182c52d8667800dab27b80f7ff18afc` |
|
| 18 |
+
| Launcher | `uruchom_109.sh` v5, SHA256 `796c71016c1e167bfd3ca98b78518f91c3502a96eac233dd7186ef6639fcc656` |
|
| 19 |
+
| Required HF-to-training converter | `hf_do_ckpt.py`, SHA256 `4990a1c2bc664417ea964a5235d702cad12bff0dc53ce08211ff9a84cbcfed64` |
|
| 20 |
+
|
| 21 |
+
With those files installed at the explicit paths, pinned base files already fetched and a newly approved clean CPT data directory:
|
| 22 |
+
|
| 23 |
+
```bash
|
| 24 |
+
START=108 GPU=B200 S=5000 KROKI=80000 CKPT_EVERY=200 NCCL_P2P_DISABLE=0 \
|
| 25 |
+
HF=/workspace/hf108 INIT=/workspace/init/init_108.pt \
|
| 26 |
+
T=/workspace/kod/train_gpt_ref_r24_2.py CONV=/workspace/kod/hf_do_ckpt.py \
|
| 27 |
+
D=/workspace/dane109cl O=/workspace/runs/109cl \
|
| 28 |
+
PY=/workspace/venv/bin/python TORCHRUN=/workspace/venv/bin/torchrun \
|
| 29 |
+
bash /workspace/kod/uruchom_109.sh
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
**Set all three overrides:** `KROKI=80000`, `S=5000`, `CKPT_EVERY=200`; v5 retains different historical defaults. `START=108` requires `--init-from` and a 2,000-update warmup. The converter passes weights/config only, not optimizer state; `--resume` recovers only this new experiment. A new output directory plus step-zero `INIT-FROM` preflight are mandatory before calling this actual CPT.
|
| 33 |
+
|
| 34 |
+
Shared architecture/batch/optimizer peaks below are unchanged: eight B200 ranks, microbatch8 × accumulation4, context4096, Muon0.02/AdamW0.0006. The selected 80,000-update plan decays in its last20% to0.00006. Target new-source mix is20%PL/80%EN, not a measured cumulative language ratio.
|
| 35 |
+
|
| 36 |
+
80,000 updates correspond to83,886,080,000 new positions. The inherited approximately23B is an upper estimate, not proof of the lower unique-history count needed for the over100B goal; final counts and exposure must verify that separately. No old95,000 default or repeated source material supplies that proof.
|
| 37 |
+
|
| 38 |
+
## Historical code identities
|
| 39 |
|
| 40 |
| Component | Identity |
|
| 41 |
|---|---|
|
| 42 |
+
| Training implementation for completed 1.08 and abandoned first 1.09 attempt | `train_gpt_ref_r24_2.py`, SHA256 `46f83b51fcec18ffc3273d80fb9eab29e182c52d8667800dab27b80f7ff18afc` |
|
| 43 |
| First 1.09 launch attempt | `uruchom_109.sh`, SHA256 `dfee11522be49c938f169ca6992cf181f86a3c4e0d26fd5b5fa3646535dc890f` |
|
| 44 |
| Launcher used for observed 1.09 slot 1 | `uruchom_109.sh` v3, SHA256 `c0a2699d1a2d7ce4cddd873ad92ff5ab5bb0dbcecc6e47d6bce01ee9b848895c` |
|
| 45 |
| Saved, actually used 1.08 argument file | SHA256 `d283bcb836e9bb89d5bf7dfa60487055086cf04620ad5c5dd36fe3435f2766a9` |
|
|
|
|
| 48 |
|
| 49 |
The recipes use one eight-GPU B200 node, PyTorch 2.8/CUDA 12.8 and DDP. They are not a four-RTX-4090 configuration. Compute uses bf16 on the verified hardware; `--dtype uint16` below describes **stored token IDs**, not model arithmetic.
|
| 50 |
|
| 51 |
+
## Historical shared learning arguments
|
| 52 |
|
| 53 |
+
These arguments occur in the saved 1.08 invocation and the abandoned from-scratch 1.09 launcher. They are not a new CPT specification:
|
| 54 |
|
| 55 |
```text
|
| 56 |
--batch 256 --grad-accum 4 --block 4096 --dtype uint16 --vocab 32768
|
|
|
|
| 65 |
|
| 66 |
Global batch is 256 sequences: eight ranks × microbatch 8 × accumulation 4. Activation checkpointing is disabled. Each update processes 1,048,576 token positions. Muon handles matrix parameters; AdamW handles the remaining parameter groups.
|
| 67 |
|
| 68 |
+
## Historical differences between the two observed experiments
|
| 69 |
|
| 70 |
+
| Setting | 1.08: saved arguments / completed run | Abandoned 1.09 from-scratch attempt |
|
| 71 |
|---|---|---|
|
| 72 |
| Weight initialization | `--init-from` the public 1.07 weights, fresh optimizer | `START=zero`; no `--init-from` |
|
| 73 |
| Total updates | `--steps 1709` | `--steps 95000` by default |
|
|
|
|
| 84 |
|
| 85 |
Output directories, run IDs, data directories, the queue manifest and `--events-jsonl` are operational arguments, not omitted learning choices. For 1.08 they identify `slayer1b_108_r1`; 1.09 uses a separate output history. Do not share output directories between experiments.
|
| 86 |
|
| 87 |
+
## Historical invocation reference — not for CPT
|
| 88 |
|
| 89 |
+
The [archived slot-1 invocation](https://huggingface.co/SlayerLab/Slayer1B-1.09/blob/89f701851c57acea4bece4de11194fac60f66a8b/TRAINING_CONFIGURATION.md) records the abandoned random-initialization attempt. It is not the current operator command, and recovery of its checkpoint is not initialization from 1.08.
|
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
+
The historical call explicitly set `S=5000` because v3 retained a different default. H200 support was a capability, not evidence of execution on H200. A future hardware change still requires numerical control and truthful metadata.
|
| 93 |
|
| 94 |
+
A future approved queue must publish new shard bytes before matching manifest ranges and digests. Old queue `6e06f097` and the replay-containing s01–s03 references do not satisfy the revised freshness requirement; new CPT inputs need new approval. Preserve sampler identity only within the same experiment, never by reusing the abandoned output history.
|
| 95 |
|
| 96 |
+
Recovery with the same output directory is valid only within one approved experiment. The new CPT must not inherit the abandoned attempt's optimizer or random-weight checkpoint. Full optimizer snapshots and weights-only milestones are distinct artifacts; the actual CPT optimizer and recovery policy must be recorded with its reviewed launcher.
|
| 97 |
|
| 98 |
+
Historical v3 could adjust total steps before decay boundaries. That capability neither selects a length for the new CPT nor turns exposure into unique-source tokens. Recompute the required addition from supported historical/new-data counts and the approved budget before publishing a definitive schedule.
|
| 99 |
|
| 100 |
## What this does not claim
|
| 101 |
|
| 102 |
+
The saved 1.08 arguments and first-attempt preflight establish those historical executions only. The old [Track run](https://track.fabryka.ai/run/08cf77cf-e995-5ee1-b843-05cbb96e4f4b) records from-scratch metrics through update 450, not CPT progress or a verified recovered checkpoint. No actual revised CPT execution or quality result is established.
|
| 103 |
|
| 104 |
+
The revised continuation also requires its newly approved data bytes, manifest, full-ancestry overlap controls and filtering artifacts. Public code inspection does not supply those data or protected evaluation material. No held-out questions, gold answers, generated evaluation outputs or private exclusion lists belong in this public bundle. See the [model card](README.md) and [data card](DATA_CARD.md) for current scope and limitations.
|
hf_do_ckpt.py
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""hf_do_ckpt.py (Hart, 09.11) — wagi HF Slayer1B 1.07 -> ckpt trenera r24.2 dla --init-from (bieg Slayer1B 1.08, 8xB200).
|
| 3 |
+
|
| 4 |
+
Eksport (eksport_hf_1b.py): stan modelu fp32 z kluczami trenera, BEZ head.weight (wiązanie z tok.weight),
|
| 5 |
+
config.json = ckpt["config"] + metadane. Tu odwrotność: head.weight = tok.weight, zapis {"model", "config", "step"}.
|
| 6 |
+
Bez sieci, bez optymalizatora (--init-from i tak bierze tylko wagi: r24.2 :1128-1140).
|
| 7 |
+
|
| 8 |
+
Kontrole (STOP przy rozjeździe):
|
| 9 |
+
1. sha256 model.safetensors / config.json / trenera = piny;
|
| 10 |
+
2. wiązanie w config.json = {"tok.weight": "head.weight"} i brak head.weight w safetensors;
|
| 11 |
+
3. strict load do klasy GPT trenera (jak nauczyciel KD, r24.2 :1160-1161) + te same klucze configu, które sprawdza --init-from;
|
| 12 |
+
4. po zapisie: ponowny torch.load(weights_only=True) i każdy tensor == safetensors bit w bit.
|
| 13 |
+
Użycie (węzeł): python hf_do_ckpt.py --pkg <katalog HF 1.07> --trainer train_gpt_ref_r24_2.py --out init_107.pt
|
| 14 |
+
"""
|
| 15 |
+
import argparse
|
| 16 |
+
import hashlib
|
| 17 |
+
import importlib.util
|
| 18 |
+
import json
|
| 19 |
+
import os
|
| 20 |
+
import sys
|
| 21 |
+
import types
|
| 22 |
+
|
| 23 |
+
import torch
|
| 24 |
+
from safetensors.torch import load_file
|
| 25 |
+
|
| 26 |
+
SHA_MODEL = "d826b4a11bf4eaccee10fe43ec19a4f6d515dfc5f3e5c859adb631f1a0b76ad5" # HF Slayer1B-1.07 model.safetensors
|
| 27 |
+
SHA_CONFIG = "9e2062501a87d0b87d7ef75ba8bc5484f3b1afdf42081e727a74dc02f5a4afce" # jego config.json
|
| 28 |
+
SHA_TRENER = "46f83b51fcec18ffc3273d80fb9eab29e182c52d8667800dab27b80f7ff18afc" # train_gpt_ref_r24_2.py
|
| 29 |
+
KLUCZE_INIT = ("vocab", "n_layer", "n_embd", "n_head") # r24.2 :1131-1133
|
| 30 |
+
KLUCZE_DFLT = (("loop", 1), ("xsa", 0), ("rope_dims", 0), ("ffn", "gelu"), ("imha_t", 0), ("kv_heads", 0)) # :1134-1138
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def stop(msg):
|
| 34 |
+
print(f"STOP: {msg}", file=sys.stderr)
|
| 35 |
+
sys.exit(2)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def sha(path):
|
| 39 |
+
h = hashlib.sha256()
|
| 40 |
+
with open(path, "rb") as f:
|
| 41 |
+
for chunk in iter(lambda: f.read(1 << 24), b""):
|
| 42 |
+
h.update(chunk)
|
| 43 |
+
return h.hexdigest()
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
def main():
|
| 47 |
+
ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
| 48 |
+
ap.add_argument("--pkg", required=True, help="katalog z model.safetensors i config.json")
|
| 49 |
+
ap.add_argument("--trainer", required=True, help="train_gpt_ref_r24_2.py")
|
| 50 |
+
ap.add_argument("--out", required=True)
|
| 51 |
+
ap.add_argument("--sha-model", default=SHA_MODEL)
|
| 52 |
+
ap.add_argument("--sha-config", default=SHA_CONFIG)
|
| 53 |
+
ap.add_argument("--sha-trener", default=SHA_TRENER)
|
| 54 |
+
a = ap.parse_args()
|
| 55 |
+
|
| 56 |
+
if os.path.exists(a.out):
|
| 57 |
+
stop(f"{a.out} istnieje")
|
| 58 |
+
model_p, config_p = os.path.join(a.pkg, "model.safetensors"), os.path.join(a.pkg, "config.json")
|
| 59 |
+
for path, want in ((model_p, a.sha_model), (config_p, a.sha_config), (a.trainer, a.sha_trener)):
|
| 60 |
+
got = sha(path)
|
| 61 |
+
if got != want:
|
| 62 |
+
stop(f"{path}: sha {got[:12]} != pin {want[:12]}")
|
| 63 |
+
|
| 64 |
+
sd = load_file(model_p, device="cpu")
|
| 65 |
+
with open(config_p, encoding="utf-8") as f:
|
| 66 |
+
cfg = json.load(f)
|
| 67 |
+
if cfg.get("tied_weights") != {"tok.weight": "head.weight"} or "head.weight" in sd or "tok.weight" not in sd:
|
| 68 |
+
stop("nieoczekiwane wiązanie wag (oczekiwane tied_weights tok.weight -> head.weight, bez head.weight w pliku)")
|
| 69 |
+
for key in KLUCZE_INIT:
|
| 70 |
+
if cfg.get(key) is None:
|
| 71 |
+
stop(f"config.json bez '{key}' (wymagane przez --init-from)")
|
| 72 |
+
sd["head.weight"] = sd["tok.weight"]
|
| 73 |
+
|
| 74 |
+
spec = importlib.util.spec_from_file_location("trener_r24_2", a.trainer)
|
| 75 |
+
trener = importlib.util.module_from_spec(spec)
|
| 76 |
+
spec.loader.exec_module(trener) # moduł ma straż __main__: import nie startuje treningu
|
| 77 |
+
with torch.random.fork_rng(devices=[]):
|
| 78 |
+
model = trener.GPT(cfg["vocab"], cfg["n_layer"], cfg["n_embd"], cfg["n_head"], cfg["block"],
|
| 79 |
+
types.SimpleNamespace(**cfg))
|
| 80 |
+
model.load_state_dict(sd, strict=True)
|
| 81 |
+
|
| 82 |
+
state = {"model": model.state_dict(), "config": cfg, "step": int(cfg.get("step", 0)),
|
| 83 |
+
"hf_init": {"model_sha256": a.sha_model, "config_sha256": a.sha_config}}
|
| 84 |
+
tmp = a.out + ".tmp"
|
| 85 |
+
torch.save(state, tmp)
|
| 86 |
+
try:
|
| 87 |
+
ck = torch.load(tmp, map_location="cpu", weights_only=True)
|
| 88 |
+
c0 = ck["config"]
|
| 89 |
+
for key in KLUCZE_INIT:
|
| 90 |
+
if c0[key] != cfg[key]:
|
| 91 |
+
stop(f"config po zapisie: {key} {c0[key]} != {cfg[key]}")
|
| 92 |
+
dflt = {key: c0.get(key, d) for key, d in KLUCZE_DFLT}
|
| 93 |
+
if set(ck["model"]) != set(sd):
|
| 94 |
+
stop(f"klucze po zapisie != safetensors+head ({len(ck['model'])} vs {len(sd)})")
|
| 95 |
+
rozne = [k for k, v in sd.items() if not torch.equal(ck["model"][k], v)]
|
| 96 |
+
if rozne:
|
| 97 |
+
stop(f"tensory po zapisie różne od safetensors: {rozne[:5]}")
|
| 98 |
+
except SystemExit:
|
| 99 |
+
os.remove(tmp)
|
| 100 |
+
raise
|
| 101 |
+
os.replace(tmp, a.out)
|
| 102 |
+
n = sum(v.numel() for k, v in sd.items() if k != "head.weight")
|
| 103 |
+
print(f"HF->CKPT OK {a.out} sha {sha(a.out)} | krok {state['step']} | P {n:,} | klucze {len(sd)} | "
|
| 104 |
+
f"config --init-from {dict((k, cfg[k]) for k in KLUCZE_INIT)} {dflt}", flush=True)
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
if __name__ == "__main__":
|
| 108 |
+
main()
|
uruchom_109.sh
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
# START=zero NCCL_P2P_DISABLE=0 bash uruchom_109.sh # każde wywołanie = następny slot (S kroków), potem SLOT DONE
|
| 7 |
# CIAGLE=1 START=zero NCCL_P2P_DISABLE=0 bash uruchom_109.sh # bez --queue-one-slot: tylko gdy manifest ma WSZYSTKIE sloty
|
| 8 |
#
|
| 9 |
-
# Wymagane env: START (zero = od zera | 107 = --init-from wag HF 1.07
|
| 10 |
# D = katalog z train.bin (shardy sklejone, uint16), val.bin, man.json {steps_per_shard, shards{id:{lo,hi,sha256,source}},
|
| 11 |
# rotations}. Kolejność dopisania shardu: NAJPIERW bajty na koniec train.bin (po GREEN W4 bajtów), POTEM manifest.
|
| 12 |
# sha256 shardu = sha256 bajtów train.bin [2·lo, 2·hi). Ograniczenia trenera (smoke): brak slotu w manifeście = trener
|
|
@@ -16,19 +16,30 @@ unset HF_TOKEN HUGGING_FACE_HUB_TOKEN HUGGINGFACE_HUB_TOKEN PYTHONPATH
|
|
| 16 |
export HF_HUB_OFFLINE=1 HF_DATASETS_OFFLINE=1 CUDA_DEVICE_ORDER=PCI_BUS_ID OMP_NUM_THREADS=8 PYTHONUNBUFFERED=1 \
|
| 17 |
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 18 |
die() { echo "STOP: $*" >&2; exit 2; }
|
| 19 |
-
: "${START:?START = zero|107}"; [[ $START = zero || $START = 107 ]] || die "START musi być zero albo
|
| 20 |
: "${NCCL_P2P_DISABLE:?jawnie NCCL_P2P_DISABLE=0|1 (B200 z NVLink: 0)}"
|
| 21 |
CIAGLE=${CIAGLE:-0}; [[ $CIAGLE = 0 || $CIAGLE = 1 ]] || die "CIAGLE = 0|1"
|
| 22 |
# Typ kart (plan B przy braku spot B200, Latarnik 19:33): ta sama matematyka i te same argumenty trenera, inna arch.
|
| 23 |
GPU=${GPU:-B200}
|
| 24 |
case $GPU in B200) ARCH=sm_100;; H200) ARCH=sm_90;; *) die "GPU musi być B200 albo H200";; esac
|
| 25 |
|
| 26 |
-
WS=${WS:-/workspace}; T=${T:-$WS/kod/train_gpt_ref_r24_2.py}; HF=${HF:-$WS/
|
| 27 |
-
D=${D:-$WS/dane109}; O=${O:-$WS/runs/109}; INIT=${INIT:-$WS/init/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
PY=${PY:-python3}; TORCHRUN=${TORCHRUN:-torchrun}; PORT=${PORT:-29551}
|
| 29 |
NGPU=8; BLOCK=4096; BATCH=256; VOCAB=32768; MICRO=8; GA=4 # pomiar 581 775 tok/s, bez act-ckpt
|
| 30 |
-
KROKI=${KROKI:-95000}; S=${S:-9500}; DECAY=0.2; DATA_SEED=20261110
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
SHA_TRENER=46f83b51fcec18ffc3273d80fb9eab29e182c52d8667800dab27b80f7ff18afc # Hart/imha/train_gpt_ref_r24_2.py
|
| 33 |
SHA_CONV=4990a1c2bc664417ea964a5235d702cad12bff0dc53ce08211ff9a84cbcfed64 # hf_do_ckpt.py (LF)
|
| 34 |
RUN_ID=slayer1b_109_$START
|
|
@@ -108,10 +119,11 @@ for g in $(seq 0 $((NGPU - 1))); do
|
|
| 108 |
done
|
| 109 |
"$PY" -c "import torch,sys; sys.exit(0 if sys.argv[1] in torch.cuda.get_arch_list() else 3)" "$ARCH" || die "torch bez $ARCH"
|
| 110 |
|
| 111 |
-
if [[ $START =
|
| 112 |
[[ $(tr -d '\r' < "$CONV" | sha256sum | cut -c1-64) = "$SHA_CONV" ]] || die "sha hf_do_ckpt.py != 4990a1c2"
|
| 113 |
-
echo "== init: wagi HF
|
| 114 |
-
mkdir -p "$(dirname "$INIT")"
|
|
|
|
| 115 |
fi
|
| 116 |
|
| 117 |
ARGS=(--data-dir "$D" --out-dir "$O" --run-id "$RUN_ID" --queue "$MAN" --resume --steps "$KROKI"
|
|
@@ -121,27 +133,29 @@ ARGS=(--data-dir "$D" --out-dir "$O" --run-id "$RUN_ID" --queue "$MAN" --resume
|
|
| 121 |
--optimizer muon --lr 6e-4 --min-lr 6e-5 --muon-lr 0.02 --wd 0.1 --grad-clip 1.0
|
| 122 |
--schedule wsd --decay-frac "$DECAY" --warmup "$WARMUP" --rewarm-steps 0
|
| 123 |
--seed 1 --data-seed "$DATA_SEED" --loss-chunk 1024 --compile
|
| 124 |
-
--log-every 10 --eval-every 1000 --eval-iters 20
|
| 125 |
--events-jsonl "$O/events.jsonl")
|
| 126 |
-
if [[ $START =
|
| 127 |
# Te same argumenty przy każdym slocie. Wyjątek: KROKI (= --steps, długość całości) wolno zmienić TYLKO przed początkiem
|
| 128 |
# wygaszania wg starej i nowej długości - w fazie stałej WSD LR nie zależy od --steps, więc kroki < K są te same.
|
|
|
|
| 129 |
NOWE_ARGS=$(printf '%q ' "${ARGS[@]}")
|
| 130 |
if [[ -s $O/args.txt ]]; then
|
| 131 |
STARE_K=$(cat "$O/kroki.txt" 2>/dev/null || echo "$KROKI")
|
| 132 |
if [[ $STARE_K != "$KROKI" ]]; then
|
| 133 |
-
[[ "${NOWE_ARGS/--steps $KROKI /--steps $STARE_K }" = "$(
|
| 134 |
|| die "zmiana KROKI $STARE_K -> $KROKI, ale inne argumenty też się różnią"
|
| 135 |
GRAN=$("$PY" -c "import sys; a,b,d=int(sys.argv[1]),int(sys.argv[2]),float(sys.argv[3]); print(min(int(a*(1-d)), int(b*(1-d))))" "$STARE_K" "$KROKI" "$DECAY")
|
| 136 |
[[ $K -lt $GRAN ]] || die "zmiana KROKI po początku wygaszania (krok $K >= $GRAN) - niedozwolona"
|
| 137 |
echo "ZMIANA KROKI $STARE_K -> $KROKI przy kroku $K (wygaszanie od $(( KROKI * 8 / 10 )))"
|
| 138 |
printf '%s' "$NOWE_ARGS" > "$O/args.txt"; echo "$KROKI" > "$O/kroki.txt"
|
| 139 |
fi
|
| 140 |
-
[[ "$NOWE_ARGS" = "$(
|
| 141 |
else
|
| 142 |
printf '%s' "$NOWE_ARGS" > "$O/args.txt"; echo "$KROKI" > "$O/kroki.txt"
|
| 143 |
fi
|
| 144 |
[[ $CIAGLE = 1 ]] || ARGS+=(--queue-one-slot)
|
|
|
|
| 145 |
|
| 146 |
echo "== torchrun $NGPU × r24.2 ($RUN_ID): kroki $K -> $E"
|
| 147 |
L0=0; [[ ! -f $O/train.log ]] || L0=$(wc -l < "$O/train.log")
|
|
@@ -157,7 +171,7 @@ preflight() { # przed 1. linią kroku: world, P, kolejka od kroku K; K=0: bez
|
|
| 157 |
|| { echo "pre-flight: kolejka nie od kroku $K / inny manifest"; return 1; }
|
| 158 |
if [[ $K = 0 ]]; then
|
| 159 |
! nowe | grep -q 'RESUME @' || { echo "pre-flight: RESUME przy kroku 0"; return 1; }
|
| 160 |
-
if [[ $START =
|
| 161 |
else ! nowe | grep -q 'INIT-FROM ' || { echo "pre-flight: INIT-FROM przy START=zero"; return 1; }; fi
|
| 162 |
else
|
| 163 |
nowe | grep -qE "RESUME @ $K\$" || { echo "pre-flight: brak RESUME @ $K"; return 1; }
|
|
|
|
| 6 |
# START=zero NCCL_P2P_DISABLE=0 bash uruchom_109.sh # każde wywołanie = następny slot (S kroków), potem SLOT DONE
|
| 7 |
# CIAGLE=1 START=zero NCCL_P2P_DISABLE=0 bash uruchom_109.sh # bez --queue-one-slot: tylko gdy manifest ma WSZYSTKIE sloty
|
| 8 |
#
|
| 9 |
+
# Wymagane env: START (zero = od zera | 107 / 108 = --init-from wag HF 1.07 / 1.08, trening kontynuowany), NCCL_P2P_DISABLE.
|
| 10 |
# D = katalog z train.bin (shardy sklejone, uint16), val.bin, man.json {steps_per_shard, shards{id:{lo,hi,sha256,source}},
|
| 11 |
# rotations}. Kolejność dopisania shardu: NAJPIERW bajty na koniec train.bin (po GREEN W4 bajtów), POTEM manifest.
|
| 12 |
# sha256 shardu = sha256 bajtów train.bin [2·lo, 2·hi). Ograniczenia trenera (smoke): brak slotu w manifeście = trener
|
|
|
|
| 16 |
export HF_HUB_OFFLINE=1 HF_DATASETS_OFFLINE=1 CUDA_DEVICE_ORDER=PCI_BUS_ID OMP_NUM_THREADS=8 PYTHONUNBUFFERED=1 \
|
| 17 |
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 18 |
die() { echo "STOP: $*" >&2; exit 2; }
|
| 19 |
+
: "${START:?START = zero|107|108}"; [[ $START = zero || $START = 107 || $START = 108 ]] || die "START musi być zero, 107 albo 108"
|
| 20 |
: "${NCCL_P2P_DISABLE:?jawnie NCCL_P2P_DISABLE=0|1 (B200 z NVLink: 0)}"
|
| 21 |
CIAGLE=${CIAGLE:-0}; [[ $CIAGLE = 0 || $CIAGLE = 1 ]] || die "CIAGLE = 0|1"
|
| 22 |
# Typ kart (plan B przy braku spot B200, Latarnik 19:33): ta sama matematyka i te same argumenty trenera, inna arch.
|
| 23 |
GPU=${GPU:-B200}
|
| 24 |
case $GPU in B200) ARCH=sm_100;; H200) ARCH=sm_90;; *) die "GPU musi być B200 albo H200";; esac
|
| 25 |
|
| 26 |
+
WS=${WS:-/workspace}; T=${T:-$WS/kod/train_gpt_ref_r24_2.py}; HF=${HF:-$WS/hf$START}; CONV=${CONV:-$WS/kod/hf_do_ckpt.py}
|
| 27 |
+
D=${D:-$WS/dane109}; O=${O:-$WS/runs/109}; INIT=${INIT:-$WS/init/init_$START.pt}; MAN=$D/man.json
|
| 28 |
+
# Piny wag startowych (publiczne paczki HF): 1.07 = SlayerLab/Slayer1B-1.07, 1.08 = SlayerLab/Slayer1B-1.08 @5f854a0c.
|
| 29 |
+
case $START in
|
| 30 |
+
107) PIN_M=d826b4a11bf4eaccee10fe43ec19a4f6d515dfc5f3e5c859adb631f1a0b76ad5; PIN_C=9e2062501a87d0b87d7ef75ba8bc5484f3b1afdf42081e727a74dc02f5a4afce;;
|
| 31 |
+
108) PIN_M=1c510d9a59d3b9e62360d1db57e08fa450fb9b09df849df7f2eef132ea6715a4; PIN_C=c4c56250100cbb26e1394977ecb613fd41bdb239128592b12a13b30613fa6a94;;
|
| 32 |
+
esac
|
| 33 |
PY=${PY:-python3}; TORCHRUN=${TORCHRUN:-torchrun}; PORT=${PORT:-29551}
|
| 34 |
NGPU=8; BLOCK=4096; BATCH=256; VOCAB=32768; MICRO=8; GA=4 # pomiar 581 775 tok/s, bez act-ckpt
|
| 35 |
+
KROKI=${KROKI:-95000}; S=${S:-9500}; DECAY=0.2; DATA_SEED=20261110
|
| 36 |
+
# Co ile kroków pełny ckpt (wznowienie po wywłaszczeniu). Nie zmienia matematyki treningu, więc wolno go zmieniać między
|
| 37 |
+
# wywołaniami (np. 100 przy częstych wywłaszczeniach spot) - poza porównaniem argumentów.
|
| 38 |
+
CKPT_EVERY=${CKPT_EVERY:-500}
|
| 39 |
+
[[ $CKPT_EVERY =~ ^[0-9]+$ && $CKPT_EVERY -ge 50 && $CKPT_EVERY -le 5000 ]] || die "CKPT_EVERY poza 50-5000"
|
| 40 |
+
# Rozgrzewka: od zera 2000; z 1.07 (stały LR, niewygaszony) 1000; z 1.08 (wygaszony do 6e-5) 2000 - łagodniejsze
|
| 41 |
+
# podniesienie LR po wygaszeniu (GoLLeM S12: skok straty przy szybkim powrocie do szczytu).
|
| 42 |
+
case $START in zero|108) WARMUP=2000;; 107) WARMUP=1000;; esac
|
| 43 |
SHA_TRENER=46f83b51fcec18ffc3273d80fb9eab29e182c52d8667800dab27b80f7ff18afc # Hart/imha/train_gpt_ref_r24_2.py
|
| 44 |
SHA_CONV=4990a1c2bc664417ea964a5235d702cad12bff0dc53ce08211ff9a84cbcfed64 # hf_do_ckpt.py (LF)
|
| 45 |
RUN_ID=slayer1b_109_$START
|
|
|
|
| 119 |
done
|
| 120 |
"$PY" -c "import torch,sys; sys.exit(0 if sys.argv[1] in torch.cuda.get_arch_list() else 3)" "$ARCH" || die "torch bez $ARCH"
|
| 121 |
|
| 122 |
+
if [[ $START != zero && $K = 0 && ! -s $INIT ]]; then
|
| 123 |
[[ $(tr -d '\r' < "$CONV" | sha256sum | cut -c1-64) = "$SHA_CONV" ]] || die "sha hf_do_ckpt.py != 4990a1c2"
|
| 124 |
+
echo "== init: wagi HF $START -> ckpt trenera (hf_do_ckpt.py, piny ${PIN_M:0:8} / ${PIN_C:0:8} / 46f83b51)"
|
| 125 |
+
mkdir -p "$(dirname "$INIT")"
|
| 126 |
+
"$PY" "$CONV" --pkg "$HF" --trainer "$T" --out "$INIT" --sha-model "$PIN_M" --sha-config "$PIN_C"
|
| 127 |
fi
|
| 128 |
|
| 129 |
ARGS=(--data-dir "$D" --out-dir "$O" --run-id "$RUN_ID" --queue "$MAN" --resume --steps "$KROKI"
|
|
|
|
| 133 |
--optimizer muon --lr 6e-4 --min-lr 6e-5 --muon-lr 0.02 --wd 0.1 --grad-clip 1.0
|
| 134 |
--schedule wsd --decay-frac "$DECAY" --warmup "$WARMUP" --rewarm-steps 0
|
| 135 |
--seed 1 --data-seed "$DATA_SEED" --loss-chunk 1024 --compile
|
| 136 |
+
--log-every 10 --eval-every 1000 --eval-iters 20
|
| 137 |
--events-jsonl "$O/events.jsonl")
|
| 138 |
+
if [[ $START != zero ]]; then ARGS+=(--init-from "$INIT"); fi
|
| 139 |
# Te same argumenty przy każdym slocie. Wyjątek: KROKI (= --steps, długość całości) wolno zmienić TYLKO przed początkiem
|
| 140 |
# wygaszania wg starej i nowej długości - w fazie stałej WSD LR nie zależy od --steps, więc kroki < K są te same.
|
| 141 |
+
bez_ckpt() { sed -E 's/--ckpt-every [0-9]+ //'; } # args.txt z v3 zawiera --ckpt-every 500 - porównujemy bez niego
|
| 142 |
NOWE_ARGS=$(printf '%q ' "${ARGS[@]}")
|
| 143 |
if [[ -s $O/args.txt ]]; then
|
| 144 |
STARE_K=$(cat "$O/kroki.txt" 2>/dev/null || echo "$KROKI")
|
| 145 |
if [[ $STARE_K != "$KROKI" ]]; then
|
| 146 |
+
[[ "${NOWE_ARGS/--steps $KROKI /--steps $STARE_K }" = "$(bez_ckpt < "$O/args.txt")" ]] \
|
| 147 |
|| die "zmiana KROKI $STARE_K -> $KROKI, ale inne argumenty też się różnią"
|
| 148 |
GRAN=$("$PY" -c "import sys; a,b,d=int(sys.argv[1]),int(sys.argv[2]),float(sys.argv[3]); print(min(int(a*(1-d)), int(b*(1-d))))" "$STARE_K" "$KROKI" "$DECAY")
|
| 149 |
[[ $K -lt $GRAN ]] || die "zmiana KROKI po początku wygaszania (krok $K >= $GRAN) - niedozwolona"
|
| 150 |
echo "ZMIANA KROKI $STARE_K -> $KROKI przy kroku $K (wygaszanie od $(( KROKI * 8 / 10 )))"
|
| 151 |
printf '%s' "$NOWE_ARGS" > "$O/args.txt"; echo "$KROKI" > "$O/kroki.txt"
|
| 152 |
fi
|
| 153 |
+
[[ "$NOWE_ARGS" = "$(bez_ckpt < "$O/args.txt")" ]] || die "argumenty inne niż przy pierwszym slocie ($O/args.txt)"
|
| 154 |
else
|
| 155 |
printf '%s' "$NOWE_ARGS" > "$O/args.txt"; echo "$KROKI" > "$O/kroki.txt"
|
| 156 |
fi
|
| 157 |
[[ $CIAGLE = 1 ]] || ARGS+=(--queue-one-slot)
|
| 158 |
+
ARGS+=(--ckpt-every "$CKPT_EVERY")
|
| 159 |
|
| 160 |
echo "== torchrun $NGPU × r24.2 ($RUN_ID): kroki $K -> $E"
|
| 161 |
L0=0; [[ ! -f $O/train.log ]] || L0=$(wc -l < "$O/train.log")
|
|
|
|
| 171 |
|| { echo "pre-flight: kolejka nie od kroku $K / inny manifest"; return 1; }
|
| 172 |
if [[ $K = 0 ]]; then
|
| 173 |
! nowe | grep -q 'RESUME @' || { echo "pre-flight: RESUME przy kroku 0"; return 1; }
|
| 174 |
+
if [[ $START != zero ]]; then nowe | grep -q 'INIT-FROM ' || { echo "pre-flight: brak INIT-FROM"; return 1; }
|
| 175 |
else ! nowe | grep -q 'INIT-FROM ' || { echo "pre-flight: INIT-FROM przy START=zero"; return 1; }; fi
|
| 176 |
else
|
| 177 |
nowe | grep -qE "RESUME @ $K\$" || { echo "pre-flight: brak RESUME @ $K"; return 1; }
|