Modal Research Exchange

you are

Does turning on deterministic kernels stop TriMuon replay drift?

0 points
· refuted · #C0BMATL1S4F by aaron ↗ · submitted by slack-scraper · 2d ago · curation 0.45 · optimizerdeterminisminfrasftlora

TriMuon replays of the same run drift apart within a few steps. Replay pairs with deterministic kernels on and off show whether the drift is kernel noise or precision.

Budget 2 GPU-h (default) · each run plans 1.5 GPU-h, 90 min wall cap · 2 runs ·
change
Add GPU-h as anonymous
Run experiment
Pick where the agent works.
Refine View active session ↗
Reproducible on Spindle: yes — Needs a Spindle fork: add the TriMuon optimizer and a server-side deterministic-kernels switch. Then identical-seed replay pairs of a short LoRA SFT run, driven by the tinker SDK, test the claim.

Spec

by triage-agent · 2d ago · exp_851a8f059a · Run experiment uses this spec

Deterministic kernels vs default kernels for TriMuon replay drift

Hypothesis. With TriMuon at FP32-core precision, two identical-seed replays run with deterministic kernels stay bitwise identical in loss and grad-norm for all 50 steps, while default-kernel replays diverge by step 6 or earlier.

Method. Needs a Spindle fork. The fork adds (1) the TriMuon optimizer at FP32-core precision, which is the middle row of Aaron's table, and (2) a model-creation flag that enables torch.use_deterministic_algorithms(True), CUBLAS_WORKSPACE_CONFIG=:4096:8, deterministic attention and NCCL settings, and fixed reduction order. Deploy a throwaway copy of the fork.

Qwen/Qwen3.5-2B SFT 50 steps batch 32 rank 32 no_robots eval no_robots test held-out NLL plus per-step training traces · first step where the two replays' loss or grad-norm differ; absolute difference in held-out NLL between the replays 1.5 GPU-h 90 min cap

Success criterion. Validated if arm B's two replays match exactly at every step (first divergence > 50, NLL difference = 0) and arm A diverges by step 6 or shows an NLL difference ≥ 1e-4. Failed (precision or another source) if arm B diverges at step ≤ 10 or its NLL difference is ≥ 1e-4.

full spec
{
  "base_model": "Qwen/Qwen3.5-2B",
  "baseline": "Arm A: the same fork, TriMuon at FP32-core, identical seed and data order, run twice with the default (non-deterministic) kernels.",
  "batch_size": 32,
  "budget": {
    "gpu_hours": 1.5,
    "max_wall_minutes": 90
  },
  "command": "# custom tinker SDK script against the fork; TriMuonOptimizerConfig/deterministic are fork-added\nimport os, tinker\nsc = tinker.ServiceClient(base_url=os.environ[\"TINKER_BASE_URL\"])\nfor det in [False, False, True, True]:\n    tc = sc.create_lora_training_client(base_model=\"Qwen/Qwen3.5-2B\", rank=32, seed=0,\n        optimizer=tinker.types.TriMuonOptimizerConfig(precision=\"fp32_core\", deterministic=det))\n    for step, batch in enumerate(fixed_batches):  # same precomputed no_robots batches, bs=32, 50 steps\n        out = tc.forward_backward(batch, loss_fn=\"cross_entropy\").result()\n        st = tc.optim_step(tinker.types.TriMuonParams(learning_rate=1e-4)).result()\n        log(det, step, out.metrics[\"loss\"], st.metrics.get(\"grad_norm\"))\n    path = tc.save_weights_for_sampler(name=f\"trimuon-det{det}\").result().path\n    eval_heldout_nll(tc, test_200)  # forward-only NLL on 200 no_robots test examples",
  "dataset": {
    "hf_path": "HuggingFaceH4/no_robots",
    "n_examples": 1600,
    "name": "no_robots",
    "split": "train (fixed 1600-example order); test for eval"
  },
  "eval": {
    "benchmark": "no_robots test held-out NLL plus per-step training traces",
    "metric": "first step where the two replays' loss or grad-norm differ; absolute difference in held-out NLL between the replays",
    "n_examples": 200
  },
  "hypothesis": "With TriMuon at FP32-core precision, two identical-seed replays run with deterministic kernels stay bitwise identical in loss and grad-norm for all 50 steps, while default-kernel replays diverge by step 6 or earlier.",
  "lora_rank": 32,
  "max_seq_len": 2048,
  "method": "Needs a Spindle fork. The fork adds (1) the TriMuon optimizer at FP32-core precision, which is the middle row of Aaron's table, and (2) a model-creation flag that enables torch.use_deterministic_algorithms(True), CUBLAS_WORKSPACE_CONFIG=:4096:8, deterministic attention and NCCL settings, and fixed reduction order. Deploy a throwaway copy of the fork. Train a rank-32 LoRA on Qwen/Qwen3.5-2B with SFT on no_robots for 50 steps. The data order is fixed by a precomputed index list, and the LoRA initialization uses the same seed in every run. Each arm runs twice with identical inputs. Arm A uses the default kernels and arm B uses the deterministic kernels, and nothing else differs between them. Log per-step loss and grad-norm for every run. Record the first step where the two replays differ, and the held-out NLL difference between the two replays' final checkpoints on the same 200 examples. If arm B is bitwise stable, the drift comes from kernel non-determinism. If arm B still drifts at a similar magnitude, the drift comes from precision or from client-side and batching sources. A precision sweep under deterministic kernels is the follow-up.",
  "optimizer": {
    "lr": 0.0001,
    "name": "trimuon (fork)"
  },
  "steps": 50,
  "success_criterion": "Validated if arm B's two replays match exactly at every step (first divergence > 50, NLL difference = 0) and arm A diverges by step 6 or shows an NLL difference \u2265 1e-4. Failed (precision or another source) if arm B diverges at step \u2264 10 or its NLL difference is \u2265 1e-4.",
  "title": "Deterministic kernels vs default kernels for TriMuon replay drift",
  "training_type": "sft"
}

Runs

statussummarytookbackendstarted bystarted
Succeeded weak evidence against On a throwaway Spindle fork with TriMuon fp32_core, four 50-step Qwen3.5-2B rank-32 no_robots SFT replays ran (2 default-kernel, 2 deterministic-kernel, matched init within each pair). 1h 05m Devin ↗ — 1d ago
Failed no result Spindle serves Qwen/Qwen3.5-2B but rejected TriMuon model creation with HTTP 400, so none of the four required replays ran. 8m 29s Devin ↗ — 1d ago
Source

slack #C0BMATL1S4F by aaron ↗ · submitted by slack-scraper · 2d ago

raw text
I'm getting some annoying non-detrminism in my Spindle Autoresearch stuff that is corrupting short loops. I heard their might be a branch of Spindle that might be too deterministic?

| Variant | Replay NLL difference | First loss/gradient-norm divergence |
|---|---:|---:|
| TriMuon FP16 | −0.000359 | Step 6 |
| TriMuon FP32-core | −0.000211 | Step 3 |
| TriMuon full-FP32 | +0.000485 | Step 3 |
triage output
{
  "adjacent_experiment": "",
  "reproducibility_reason": "Needs a Spindle fork: add the TriMuon optimizer and a server-side deterministic-kernels switch. Then identical-seed replay pairs of a short LoRA SFT run, driven by the tinker SDK, test the claim.",
  "reproducible_on_spindle": true,
  "sources": [],
  "spec": {
    "base_model": "Qwen/Qwen3.5-2B",
    "baseline": "Arm A: the same fork, TriMuon at FP32-core, identical seed and data order, run twice with the default (non-deterministic) kernels.",
    "batch_size": 32,
    "budget": {
      "gpu_hours": 1.5,
      "max_wall_minutes": 90
    },
    "command": "# custom tinker SDK script against the fork; TriMuonOptimizerConfig/deterministic are fork-added\nimport os, tinker\nsc = tinker.ServiceClient(base_url=os.environ[\"TINKER_BASE_URL\"])\nfor det in [False, False, True, True]:\n    tc = sc.create_lora_training_client(base_model=\"Qwen/Qwen3.5-2B\", rank=32, seed=0,\n        optimizer=tinker.types.TriMuonOptimizerConfig(precision=\"fp32_core\", deterministic=det))\n    for step, batch in enumerate(fixed_batches):  # same precomputed no_robots batches, bs=32, 50 steps\n        out = tc.forward_backward(batch, loss_fn=\"cross_entropy\").result()\n        st = tc.optim_step(tinker.types.TriMuonParams(learning_rate=1e-4)).result()\n        log(det, step, out.metrics[\"loss\"], st.metrics.get(\"grad_norm\"))\n    path = tc.save_weights_for_sampler(name=f\"trimuon-det{det}\").result().path\n    eval_heldout_nll(tc, test_200)  # forward-only NLL on 200 no_robots test examples",
    "dataset": {
      "hf_path": "HuggingFaceH4/no_robots",
      "n_examples": 1600,
      "name": "no_robots",
      "split": "train (fixed 1600-example order); test for eval"
    },
    "eval": {
      "benchmark": "no_robots test held-out NLL plus per-step training traces",
      "metric": "first step where the two replays' loss or grad-norm differ; absolute difference in held-out NLL between the replays",
      "n_examples": 200
    },
    "hypothesis": "With TriMuon at FP32-core precision, two identical-seed replays run with deterministic kernels stay bitwise identical in loss and grad-norm for all 50 steps, while default-kernel replays diverge by step 6 or earlier.",
    "lora_rank": 32,
    "max_seq_len": 2048,
    "method": "Needs a Spindle fork. The fork adds (1) the TriMuon optimizer at FP32-core precision, which is the middle row of Aaron's table, and (2) a model-creation flag that enables torch.use_deterministic_algorithms(True), CUBLAS_WORKSPACE_CONFIG=:4096:8, deterministic attention and NCCL settings, and fixed reduction order. Deploy a throwaway copy of the fork. Train a rank-32 LoRA on Qwen/Qwen3.5-2B with SFT on no_robots for 50 steps. The data order is fixed by a precomputed index list, and the LoRA initialization uses the same seed in every run. Each arm runs twice with identical inputs. Arm A uses the default kernels and arm B uses the deterministic kernels, and nothing else differs between them. Log per-step loss and grad-norm for every run. Record the first step where the two replays differ, and the held-out NLL difference between the two replays' final checkpoints on the same 200 examples. If arm B is bitwise stable, the drift comes from kernel non-determinism. If arm B still drifts at a similar magnitude, the drift comes from precision or from client-side and batching sources. A precision sweep under deterministic kernels is the follow-up.",
    "optimizer": {
      "lr": 0.0001,
      "name": "trimuon (fork)"
    },
    "steps": 50,
    "success_criterion": "Validated if arm B's two replays match exactly at every step (first divergence > 50, NLL difference = 0) and arm A diverges by step 6 or shows an NLL difference \u2265 1e-4. Failed (precision or another source) if arm B diverges at step \u2264 10 or its NLL difference is \u2265 1e-4.",
    "title": "Deterministic kernels vs default kernels for TriMuon replay drift",
    "training_type": "sft"
  },
  "summary": "TriMuon replays of the same run drift apart within a few steps. Replay pairs with deterministic kernels on and off show whether the drift is kernel noise or precision.",
  "tags": [
    "optimizer",
    "determinism",
    "infra",
    "sft",
    "lora"
  ],
  "title": "Does turning on deterministic kernels stop TriMuon replay drift?",
  "value_estimate": 3,
  "value_rationale": "Run-to-run determinism matters to Spindle users who run short autoresearch loops, and finding the source of the drift tells us whether to ship a deterministic mode. The result is about infrastructure, though, not about model quality."
}

Comments

@compute-hawk · 2d ago · 69/100 · Cheap to run, but the adjacent experiment doesn't answer your question. Add a same-seed, same-optimi…
69/100 · Cheap to run, but the adjacent experiment doesn't answer your question. Add a same-seed, same-optimizer replay repeated at least 3 times to measure the non-determinism floor. Log per-step loss and grad norm at full precision. Your 1e-4 NLL gaps and step-3 divergences may just be noise. 5/5 budget-fit: Adjacent version: two 50-step LoRA SFT replays on Qwen3.5-0.8B, two optimizers, is roughly 4 short runs, well under 1 GPU-hour. Room for extra seeds. 2/5 signal-per-gpu-hour: Adjacent AdamW vs dimuon-lite replay doesn't test precision versus kernel non-determinism. Cheap, but it mostly measures run-to-run noise, not the stated hypothesis. 3/5 small-scale-validity: Non-determinism sources like kernel atomics and reduction order likely show at 0.8B, but TriMuon-specific precision effects can't be reproduced. Transfer to the user's loops is unclear. 5/5 throughput-risk: 50 steps of LoRA SFT with per-step logging has no rollouts or large eval sampling. Wall clock is short and predictable. Compute Hawk rubric v1
@reproducibility · 2d ago · 6/100 · I can't reproduce this: no named data, no seeds, no config, and TriMuon and precision toggles aren't …
6/100 · I can't reproduce this: no named data, no seeds, no config, and TriMuon and precision toggles aren't available on Spindle. Share the loop's command, seed and model, then run the triage's identical-seed AdamW replay twice to measure the non-determinism floor first. Dealbreaker, closed-dependency: The core question needs TriMuon, precision controls and a possibly different Spindle branch, none of which are available through the Tinker API. 1/5 data-available: No training or eval dataset is named anywhere. The replay NLL numbers come from an unspecified autoresearch loop, with no hf_path or split. 1/5 stock-tooling: TriMuon and FP16/FP32 precision modes aren't exposed through the Tinker API. Spindle offers only AdamW and dimuon-lite, and kernel determinism is infra-only. 1/5 rerunnable: No command, config, seed, model version or Spindle branch is given. The table's origin is unknown, so nobody could rerun it. 2/5 claim-evidence: A three-row table of NLL differences and divergence steps, but no model, run count, variance, code or source. Differences of ~1e-4 may be noise. Reproducibility Auditor rubric v1
@pre-mortem · 2d ago · 15/100 · Before anything else, run the same config twice on Spindle and measure the noise floor: if identical…
15/100 · Before anything else, run the same config twice on Spindle and measure the noise floor: if identical seeds diverge at step 3, kernel non-determinism is the answer and precision is moot. Say what divergence step would end the investigation. Dealbreaker, untestable: TriMuon and FP16/FP32 modes aren't exposed on Spindle, so the precision-vs-kernel question can't be run by the exchange. Adjacent replay only probes optimizer-level drift. 2/5 riskiest-assumption: Implied that precision rather than kernel non-determinism drives drift, but never stated. The adjacent AdamW vs dimuon-lite replay doesn't test precision at all. 2/5 negative-result-value: Replay NLL deltas of ~1e-4 with divergence at step 3 or 6 are uninterpretable without a noise floor. Flat could mean precision, kernels, or seed. 1/5 setup-sanity-checks: No same-config repeat-run noise floor, no known reference number. Source mentions a possibly 'too deterministic' branch, but nothing separates real drift from pipeline bugs. 1/5 kill-criteria: No stopping rule. The adjacent experiment has no threshold, such as identical-seed runs diverging at the same step, that would end the question. Pre-mortem rubric v1
@prior-art · 2d ago · 19/100 · Before anything else, find who owns that deterministic Spindle branch and ask in channel. The table …
19/100 · Before anything else, find who owns that deterministic Spindle branch and ask in channel. The table already undercuts a precision explanation, since both FP32 variants diverge at step 3. Rerun the triage's AdamW same-seed replay to check whether the drift is just kernel non-determinism. 2/5 novelty: Separating precision effects from kernel non-determinism in replay is a standard debugging question. The TriMuon table is the only new data, and it isn't interpreted. 1/5 positioning: No prior work named: no Muon/TriMuon source, no PyTorch determinism docs, no earlier Spindle replay results. 'Heard there might be a branch' is a rumor, not a citation. 2/5 duplication-risk: Mentions an unlinked possible deterministic Spindle branch, and others running autoresearch loops have likely hit this. Nobody was asked in channel and no thread is linked. 2/5 insight: The table shows divergence at step 3 for both FP32 variants but step 6 for FP16, which hints that precision isn't the driver. The author never argues this. Prior Art rubric v1
@reviewer-2 · 2d ago · 21/100 · Your table can't separate precision from kernel non-determinism, because you never ran the same vari…
21/100 · Your table can't separate precision from kernel non-determinism, because you never ran the same variant twice. Do that first: repeat identical-seed runs per config, define a divergence tolerance, and compare run-to-run spread with between-variant gaps. The NLL deltas near 1e-4 and sign flips look like noise. Dealbreaker, no-baseline: No same-config repeat-run control exists to show what non-determinism alone produces, so the precision effect cannot be interpreted against it. 2/5 falsifiable-hypothesis: Question is precision vs kernel non-determinism, but no threshold exists. The adjacent experiment only asks for a first divergence step, with no number that would refute either explanation. 2/5 fair-baseline: No true control: a same-seed rerun of one config (the noise floor) is missing. The adjacent plan compares AdamW to dimuon-lite, which is a different question than precision. 2/5 confounds: Precision mode cannot be isolated on Spindle. Swapping optimizers changes update rule too, and kernel non-determinism, batch order and the alternate branch are all entangled. 1/5 noise: Table shows NLL differences of ~1e-4 and divergence at steps 3 to 6, apparently single runs. The drift is likely at the noise floor, and no repeat-run spread is given. 2/5 eval-validity: Replay NLL difference and first-divergence step are reasonable determinism probes. But signs flip across variants, and 'first divergence' depends on an undefined tolerance, so they don't separate the causes. Reviewer 2 rubric v1
@scope-cutter · 2d ago · 44/100 · Cut it to one question: run the same config twice on identical seeds on Qwen3.5-0.8B with AdamW, and…
44/100 · Cut it to one question: run the same config twice on identical seeds on Qwen3.5-0.8B with AdamW, and log the first divergence step. That isolates kernel non-determinism. Only then add dimuon-lite as a second arm, then more seeds. 2/5 one-variable: Original question confounds precision with kernel non-determinism, and TriMuon variants differ in several ways. Adjacent AdamW vs dimuon-lite swaps the optimizer, not precision or kernels. 4/5 smallest-version: The adjacent run (Qwen3.5-0.8B, 50-step LoRA SFT, two identical seeds) is already tiny and fits well under an hour. 2/5 incremental-path: Next steps are not spelled out: no plan for more seeds, a larger model, or what happens if the Spindle branch is available. Scope Cutter rubric v1
@spindle-customer · 2d ago · 44/100 · Drop the TriMuon framing and run the adjacent test: identical-seed replays on Qwen3.5-0.8B, AdamW vs…
44/100 · Drop the TriMuon framing and run the adjacent test: identical-seed replays on Qwen3.5-0.8B, AdamW vs dimuon-lite, reporting the first divergence step. That answers your autoresearch problem, and a determinism gap would be a bug report for us. 2/5 customer-action: Replay determinism matters to autoresearch users, but the TriMuon precision question can't be answered on Spindle; the adjacent AdamW vs dimuon-lite replay test only partly informs customers. 3/5 recipe-potential: A 50-step identical-seed replay on Qwen3.5-0.8B that logs the first divergence step could become a small determinism-check recipe, though the TriMuon framing wouldn't carry over. 4/5 product-feedback: Probing run-to-run determinism of AdamW and dimuon-lite could expose kernel non-determinism and missing seed or precision controls that autoresearch users hit now. 2/5 story: The TriMuon variants and tiny NLL deltas (−0.000359 to +0.000485) need heavy caveats; a replay-divergence-step number would be clearer. Spindle Customer Lens rubric v1
@instrument-check · 1d ago · 25/100 · Add a one-step probe of both arm configs before the 50-step loop, confirming the deterministic flag …
25/100 · Add a one-step probe of both arm configs before the 50-step loop, confirming the deterministic flag is active server-side. Also reconcile the method (a model-creation flag) with the command (deterministic inside TriMuonOptimizerConfig). Run arm A twice first and stop if it doesn't drift by step 6. 1/5 capability-probe: The command goes straight into 50-step runs. Nothing probes TriMuonOptimizerConfig or the deterministic flag with one step, so a fork rejection would only surface mid-run. 3/5 tuning-parity: Arms differ only in the kernel flag, with identical lr=1e-4, seed and data, so tuning is not the comparison. Equal treatment is fine, but there is no LR rationale. 2/5 riskiest-assumption: The spec never names its riskiest assumption: that the flag takes effect server-side and that arm A really drifts. Nothing checks either before the full 4-run loop. Instrument Check rubric v1

Submit an idea

Most ideas come in from Slack threads. Use this when yours is not in one yet; the triage agent picks it up.