Skip to content

🔄 dataset: revert subnet to Nemotron-CC-Math + C4 (exp_nemotron_c4, group 4) - #203

Merged
george-connito merged 3 commits into
masterfrom
feat/revert-dataset-to-nemotron-c4
Jul 31, 2026
Merged

🔄 dataset: revert subnet to Nemotron-CC-Math + C4 (exp_nemotron_c4, group 4)#203
george-connito merged 3 commits into
masterfrom
feat/revert-dataset-to-nemotron-c4

Conversation

@george-connito

Copy link
Copy Markdown
Collaborator

PR #186 switched the subnet from math data to legal data. Despite touching 9 files, the switch itself was one line: the locked TaskCfg.expert_group_name default. This reverts the DATASET while keeping everything layered on top since — the anti-memorization eval pipeline, the telemetry/recovery work, and the bittensor 10.5 chain fix all live in shared code and are dataset-agnostic.

New expert group exp_nemotron_c4 (group_id 4) rather than reactivating exp_math (group 0), so the cutover is clean and doesn't inherit group 0's history. exp_math and exp_legal are left on disk for reference.

Two improvements are retained deliberately rather than by accident:

  • dataset_class is intentionally UNSET, which resolves to DefaultStreamingTorchDataset and therefore tokenize_windowed. exp_math/dataset.py still prefix-truncates, so pointing at it would have silently dropped the windowing fix ("exp_math left for follow-up", d7e979c).
  • Both sources are pinned to commit SHAs via eval_source_revision_pin. _KNOWN_SOURCES declares revision="main" for c4/Nemotron, and main is a moving target — an HF re-upload mid-rollout would make two validators read different rows for the same seed and break weight consensus.

The legal-tuned eval gates are inherited unchanged after measuring them against the new mix (600 rows/source): c4 0% empty / 5.5% under 200 chars, Nemotron 0% / 0%, prefix-dedup 0% on both — versus Multi_Legal_Pile's 38% empty and 75% duplicate prefixes. Effectively inert here, so no override.

Expert assignment is copied from exp_math, verified valid for the current post-#188 (2Fnat) architecture rather than assumed: #188 regenerated that file itself (68a878e, 208->187 experts) and nothing architectural has landed since. Confirmed by building the partial model — 52 MoE modules across layers 1..26 for trainable group 4 + helper group 2, n_routed_experts=64, expert ids 0..63 all in range.

Docs: miner-faq updated for the new group, plus three stale claims corrected while in there — "8 experts per MoE layer" (it is 64), "miners self-select their group" (the field is locked and resets on load), and sequence_length=4096 (1024 since #188). exp_legal README and the migration plan are marked historical.

ROLLOUT — fleet-wide flag day, not a rolling change:

  • Validators only score miners whose chain commit expert_group matches, so miners still on group 3 become invisible and earn nothing until they upgrade. Announce before tagging.
  • nvidia/Nemotron-CC-Math-v1 is GATED. Every validator and miner HF_TOKEN must belong to an account that accepted the license — metadata reads fine without it, so this fails late at dataloader build with GatedRepoError, not at startup.
  • Fresh checkpoint dir (checkpoint_path is group-scoped), so the model restarts from base and baseline loss re-converges over several cycles.

Verified in the v0.3.4 image: config resolution, locked-field reset from a stale exp_legal YAML, seeded shard-pick on both sources honouring the pins, non-prefix windowing, live eval stream, and the full suite showing exactly the 4 pre-existing master failures and no new ones.

george-connito and others added 3 commits July 31, 2026 14:12
…chema v3)

Startup recovery restored telemetry at most ONCE, and `val_loss` had no
recovery path at all. Two Watchtower restarts 25 minutes apart on
2026-07-31 left every per-miner family at zero series for 17 minutes and
lost cycle 16684's losses permanently.

Three coupled gaps, one schema bump:

1. `val_loss` is journaled (v3 `uid_to_val_loss`). It is published at eval
   time and is NOT derivable from `scores`: `delta = max(0.0, baseline -
   val_loss)` clamps at zero, so every miner scoring 0 — the majority in
   many rounds — would be underivable. Plumbed through `MinerEvalJob.val_loss`
   → `Round.mark_scored(..., val_loss=)` → `Round.val_losses` → journal;
   both eval paths (foreground + background) pass it.

2. Recovery now re-emits telemetry on EVERY restart, not just the first.
   The replay loop only touches unfinalized journals, and replaying one
   marks it finalized — so the second restart found nothing and emitted
   nothing. New `republish_telemetry_from_journal` reads the newest
   finalized journal and sets the gauges directly.

   It is deliberately METRICS-ONLY. Re-running `finalize_round_scores`
   would keep the aggregator's point set correct (`drop_round` runs first)
   but re-stamp those points with fresh `_utc_now()` timestamps, shoving
   them to the end of the time-ordered series — and the rolling average is
   "last N by timestamp", which is what drives weight submission. A
   re-finalize would therefore silently reshuffle the scoring window. A
   test asserts the pass makes zero mutating aggregator calls.

3. The round-level counters (`validator_round_miners_{scored,pending,
   failed}`, `lifecycle_step`, `current_round_id`) now restore via that
   same pass, so they cover the finalized path too rather than inheriting
   the once-only limitation. `roster_size` + `lifecycle_step` are journaled
   (v3) to feed them; pre-v3 journals clamp pending to 0 rather than
   inventing a denominator.

`verdict_uids` mirrors finalize's entry set exactly — scored ∪
validation-failed ∪ freeze-zero, excluding operational failures, which get
no aggregator entry so telemetry must not imply they were judged.

`from_json` still accepts v1/v2 (missing fields default). Verified against
the v0.3.4 image: the suite's failure set is byte-identical before and
after this change (4 pre-existing failures, unrelated), and the 49 tests
across the journal/telemetry suites pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…roup 4)

PR #186 switched the subnet from math data to legal data. Despite touching 9
files, the switch itself was one line: the locked `TaskCfg.expert_group_name`
default. This reverts the DATASET while keeping everything layered on top
since — the anti-memorization eval pipeline, the telemetry/recovery work, and
the bittensor 10.5 chain fix all live in shared code and are dataset-agnostic.

New expert group `exp_nemotron_c4` (group_id 4) rather than reactivating
exp_math (group 0), so the cutover is clean and doesn't inherit group 0's
history. `exp_math` and `exp_legal` are left on disk for reference.

Two improvements are retained deliberately rather than by accident:

- `dataset_class` is intentionally UNSET, which resolves to
  `DefaultStreamingTorchDataset` and therefore `tokenize_windowed`.
  `exp_math/dataset.py` still prefix-truncates, so pointing at it would have
  silently dropped the windowing fix ("exp_math left for follow-up", d7e979c).
- Both sources are pinned to commit SHAs via `eval_source_revision_pin`.
  `_KNOWN_SOURCES` declares `revision="main"` for c4/Nemotron, and `main` is a
  moving target — an HF re-upload mid-rollout would make two validators read
  different rows for the same seed and break weight consensus.

The legal-tuned eval gates are inherited unchanged after measuring them
against the new mix (600 rows/source): c4 0% empty / 5.5% under 200 chars,
Nemotron 0% / 0%, prefix-dedup 0% on both — versus Multi_Legal_Pile's 38%
empty and 75% duplicate prefixes. Effectively inert here, so no override.

Expert assignment is copied from exp_math, verified valid for the current
post-#188 (2Fnat) architecture rather than assumed: #188 regenerated that
file itself (68a878e, 208->187 experts) and nothing architectural has landed
since. Confirmed by building the partial model — 52 MoE modules across layers
1..26 for trainable group 4 + helper group 2, n_routed_experts=64, expert ids
0..63 all in range.

Docs: miner-faq updated for the new group, plus three stale claims corrected
while in there — "8 experts per MoE layer" (it is 64), "miners self-select
their group" (the field is locked and resets on load), and
`sequence_length=4096` (1024 since #188). exp_legal README and the migration
plan are marked historical.

ROLLOUT — fleet-wide flag day, not a rolling change:
- Validators only score miners whose chain commit `expert_group` matches, so
  miners still on group 3 become invisible and earn nothing until they upgrade.
  Announce before tagging.
- `nvidia/Nemotron-CC-Math-v1` is GATED. Every validator and miner HF_TOKEN
  must belong to an account that accepted the license — metadata reads fine
  without it, so this fails late at dataloader build with GatedRepoError, not
  at startup.
- Fresh checkpoint dir (checkpoint_path is group-scoped), so the model restarts
  from base and baseline loss re-converges over several cycles.

Verified in the v0.3.4 image: config resolution, locked-field reset from a
stale exp_legal YAML, seeded shard-pick on both sources honouring the pins,
non-prefix windowing, live eval stream, and the full suite showing exactly the
4 pre-existing master failures and no new ones.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both changes require a coordinated fleet restart, so they ship in one
release rather than two. They are independent — disjoint file sets, common
base 3425d0d — but combining them means miners and validators absorb a
single restart instead of two, which matters here because a restart
abandons the in-flight background evaluation.

Merging this branch will auto-close PR #200; its commit rides along
unchanged.
@george-connito
george-connito merged commit 4db4d8d into master Jul 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants