diff --git a/README.md b/README.md index 32897cd3e640101ba184f8c4ccd896981de3804a..16eb06471fb11d770343677c615ab2a88151e9ae 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,171 @@ --- license: mit +library_name: onnx +tags: + - onnx + - fusion + - plasma-physics + - tokamak + - diii-d + - state-space-model + - mamba + - time-series + - real-time --- + +# fuse29 — Mamba-2 pedestal predictor for DIII-D + +A 29-input, 6-layer Mamba-2 state-space model that predicts nine pedestal +quantities at ρ_tor = 0.85 from DIII-D actuator settings, at 20 Hz, with a +strictly causal O(1)-per-tick inference path suitable for real-time control. + +Packaged as two ONNX graphs with normalisation baked in: **raw physical units +in, physical units out.** + +| | | +|---|---| +| Parameters | 11,254,425 | +| Architecture | Mamba-2 (SSD), 6 layers, d_model 512, d_state 128 | +| Inputs | 29 actuator channels, physical units | +| Outputs | 9 heads, physical units | +| Cadence | 20 Hz (50 ms) | +| Precision | float32 | +| ONNX opset | 17 | +| Step latency | ~2.9 ms/tick, CPU, batch 1 | +| License | MIT | + +## Intended use + +Predicting pedestal density, temperature, rotation, heights and locations from +the actuator request, inside FUSE or an equivalent DIII-D control or analysis +pipeline. The step graph is designed for the 50 ms control cycle; the sequence +graph is for offline scoring and replay. + +**Not** intended for other machines, other radial locations, or as a +safety-critical interlock. It has no uncertainty estimate and no +out-of-distribution detector. + +## Quickstart + +```bash +pip install numpy onnxruntime +``` + +```python +from fuse29.runtime import Fuse29Predictor + +predictor = Fuse29Predictor.from_pretrained("SCS-Lab/FUSE29-Pedestal-model") # loads seed 0 +state = predictor.init_state() + +for actuators in shot: # (29,) float32, raw physical units + out, state = predictor.step(actuators, state) + if out.is_hmode: + print(out.ne, out.te_ped, out.neped_prmtan) +``` + +Or straight from onnxruntime, with no Python package — the full contract is +about fifteen lines and is written out in `docs/ONNX.md`. + +## Files + +Per seed (`s0/` … `s7/`): + +| File | | +|---|---| +| `fuse29_step.onnx` | one 50 ms tick, carries state, no length limit | +| `fuse29_seq.onnx` | whole shot at a fixed 256 ticks | +| `model_config.json` | I/O contract: names, order, units, sources, shapes | +| `norms.json` | the statistics baked into the graphs | +| `actuator_ranges.json` | training-split distribution, for checking your units | +| `provenance.json` | source checkpoint SHA-256, library versions, artefact hashes | + +Plus `manifest.json` at the root. **Seed 0 is the champion and the default.** + +## Inputs + +29 DIII-D actuator channels in raw physical units: beam power (MW) and torque, +ECH power, the eighteen shaping F-coil currents (A), both E-coil currents (A), +five gas valve flows (Torr·L/s), and the toroidal field (T). Order is +load-bearing; see `docs/IO_CONTRACT.md`. + +`pohm`, `ip` and `ipspr15v` are deliberately excluded — they are plasma +responses, not commands, and a model predicting the response must not be +handed it. + +## Outputs + +| # | Head | Units | +|--:|---|---| +| 0 | `ne` | 10¹⁹ m⁻³ | +| 1 | `te_ped` | keV | +| 2 | `ti_ped` | keV | +| 3 | `t_rot_ped` | krad/s | +| 4 | `neped_prmtan` * | 10¹⁹ m⁻³ | +| 5 | `teped_prmtan` * | keV | +| 6 | `rho_sym` * | ρ_tor | +| 7 | `ne_top_loc` * | ρ_tor | +| 8 | `hmode` | probability | + +\* **H-mode only.** See the limitations below. + +## Performance + +Seed 0, scored with the exported ONNX graph on 4087 held-out shots. Median of +per-shot RMSE: + +| Head | Median per-shot RMSE | Units | +|---|---:|---| +| `ne` | 0.3057 | 10¹⁹ m⁻³ | +| `te_ped` | 0.0605 | keV | +| `ti_ped` | 0.1065 | keV | +| `t_rot_ped` | 4.1497 | krad/s | +| `neped_prmtan` * | 0.3950 | 10¹⁹ m⁻³ | +| `teped_prmtan` * | 0.0783 | keV | +| `rho_sym` * | 0.0113 | ρ_tor | +| `ne_top_loc` * | 0.0134 | ρ_tor | +| `hmode` | 0.9443 accuracy, 0.9476 F1 | — | + +ONNX-vs-PyTorch parity is within 2.5e-05 of a head's training standard +deviation across all eight seeds and both graphs. Full protocol: +`docs/VALIDATION.md`. + +## Training + +~40 900 DIII-D shots, 20 Hz, labels as trailing-bin means with empty bins +masked rather than filled. Stratified random 80/10/10 split (seed 20260829). +AdamW, lr 2e-4, cosine schedule, 25 epochs, batch 128. Checkpoint selected on +lowest total validation loss across all nine heads. + +Eight seeds are published; they differ only in weight initialisation and data +ordering. Full recipe in `docs/TRAINING.md`. + +## Limitations + +- **Four heads are undefined in L-mode.** `neped_prmtan`, `teped_prmtan`, + `rho_sym` and `ne_top_loc` were trained only on H-mode ticks. The graph + emits them unconditionally anyway. You must gate on the model's own `hmode` + output, which is ~94% accurate with errors concentrated at L–H transitions. + See `docs/GATING.md`. +- **Beam power is a live input in this package.** The predecessor (`fuse29_s*`) + could not see `pinj` because a corrupted shot set the divisor to 194 MW. + These weights were retrained against winsorised actuator statistics; a + half-range `pinj` swing now moves `ne` by 0.79. Isolated sweeps are not a + real power scan — other actuators stay at recorded values. See + `docs/LIMITATIONS.md`. +- **Accuracy measures interpolation.** The split is random, so validation + shots come from the same campaigns as training shots. A chronological split + scores roughly 1.5–2× worse. Expect degradation outside the training + distribution, with no built-in warning. +- **No uncertainty.** Seed spread measures optimisation variance, not + predictive uncertainty, and says nothing about errors all eight seeds share. +- **Units have no guard rail.** `pinj` is MW, not W. A unit error produces + confident nonsense rather than an exception; run + `predictor.check_units(shot)` once during integration. +- **Fixed 50 ms cadence**, all 29 channels required every tick, no + missing-channel handling, no dropped-tick recovery. +- **Sequence graph is fixed at 256 ticks.** Use the step graph for anything + longer. +- **float32 only**; no quantised variants are published or validated. +- DIII-D only, ρ_tor = 0.85 only. + +Full discussion in `docs/LIMITATIONS.md`. diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..9a7946c5af3eeea2f1276cb53664036a7c544a9f --- /dev/null +++ b/manifest.json @@ -0,0 +1,323 @@ +{ + "schema_version": 2, + "model": "fuse29", + "repo_id": "SCS-Lab/FUSE29-Pedestal-model", + "default_seed": 0, + "onnx_opset": 17, + "actuator_space": "physical", + "heads": [ + "ne", + "te_ped", + "ti_ped", + "t_rot_ped", + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc", + "hmode" + ], + "actuators": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "hmode_gated_heads": [ + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc" + ], + "note": "Eight independently trained seeds, differing only in weight initialisation and data ordering. s0 is the locked champion and the default. The others exist so a consumer can measure spread across training runs; they are not a jointly trained ensemble, and averaging them is a choice rather than the intended use.", + "bundles": [ + { + "seed": 0, + "path": "s0", + "default": true, + "val_loss": 1.1169083155691624, + "seq_len": 256, + "files": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "9150698ab06af368eec857ea429191bf8a0593e9fd9d7e571bb7ce5bcbcf853a" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "0274ad98cc51ee938422f3c9febd3c3cf3141a35d39ff2a62efeb75f9ce43577" + }, + "model_config.json": { + "bytes": 7112, + "sha256": "10779e134e2f65f92ef6955833c7b2af73119e069e2e31c2cfb0be563bc0bf3b" + }, + "norms.json": { + "bytes": 7840, + "sha256": "f39e579358c10911e79f2bfca2f38f76549e86462a4952ff68f009da0aca8118" + }, + "actuator_ranges.json": { + "bytes": 17917, + "sha256": "ccc717f12f66944e120b4a01dbf4ddd090c444ceff50a2613d0992a765b92a44" + }, + "provenance.json": { + "bytes": 1198, + "sha256": "e948d64c89bf320d0b747624e69ce86e6f645c2a9d7a9096bdb8efa149e47b36" + } + } + }, + { + "seed": 1, + "path": "s1", + "default": false, + "val_loss": 1.1129196528345346, + "seq_len": 256, + "files": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "8780126cca821664426bafdd896a1313846da69ad120b9c591d90dc0cc21249e" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "3469221c38b1006a017506969d2ffd5f9b84a9a34d22b4429184a299c2438f4a" + }, + "model_config.json": { + "bytes": 7112, + "sha256": "337fb9444a95c26d458a48cb8bbf83d16fa62436b509a8e9ad5fd9c424b1a55a" + }, + "norms.json": { + "bytes": 7840, + "sha256": "f39e579358c10911e79f2bfca2f38f76549e86462a4952ff68f009da0aca8118" + }, + "actuator_ranges.json": { + "bytes": 17917, + "sha256": "ccc717f12f66944e120b4a01dbf4ddd090c444ceff50a2613d0992a765b92a44" + }, + "provenance.json": { + "bytes": 1198, + "sha256": "7e4895c944d4423e4fee54a887652ead81d158684a996a05cdebb5ba7aa21962" + } + } + }, + { + "seed": 2, + "path": "s2", + "default": false, + "val_loss": 1.119664316996932, + "seq_len": 256, + "files": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "b696b9c645441cde3881ff796aaec6e1927335daba4539095f6b6dee8a5768f4" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "1fc339449427dfe47ee425eb7ff500887e6a10ae1ef32d90207f2d1e3a828cf3" + }, + "model_config.json": { + "bytes": 7111, + "sha256": "3f4859e8942bedcedb8860a50d6150f6189860868a2236094079c58fae273f2d" + }, + "norms.json": { + "bytes": 7840, + "sha256": "f39e579358c10911e79f2bfca2f38f76549e86462a4952ff68f009da0aca8118" + }, + "actuator_ranges.json": { + "bytes": 17917, + "sha256": "ccc717f12f66944e120b4a01dbf4ddd090c444ceff50a2613d0992a765b92a44" + }, + "provenance.json": { + "bytes": 1198, + "sha256": "86a2e05a5af2851c400d6f5d5847832e5cee0f079bc4f8223f380c953dff336c" + } + } + }, + { + "seed": 3, + "path": "s3", + "default": false, + "val_loss": 1.1190400626510382, + "seq_len": 256, + "files": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "f2b80d7f732cef7a21eb21e606cf4a3e63aa4a91a9ff6dde789d88e07fcd5418" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "ab580c091de0471edc8454085dcda9c88650e4995be5c2ec6bd7f8b1c87d7786" + }, + "model_config.json": { + "bytes": 7112, + "sha256": "cea93ee7706b95023550a1085349bb581679c05695ab7aba421f157c51d19c93" + }, + "norms.json": { + "bytes": 7840, + "sha256": "f39e579358c10911e79f2bfca2f38f76549e86462a4952ff68f009da0aca8118" + }, + "actuator_ranges.json": { + "bytes": 17917, + "sha256": "ccc717f12f66944e120b4a01dbf4ddd090c444ceff50a2613d0992a765b92a44" + }, + "provenance.json": { + "bytes": 1198, + "sha256": "0cdcf038de7a1a94fe1f763dd5f69d5f6aff58abf74d168a9864caaa1827331c" + } + } + }, + { + "seed": 4, + "path": "s4", + "default": false, + "val_loss": 1.1320768278092146, + "seq_len": 256, + "files": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "7c74bffd61e2c69cae1b8b182fbde8897ce971901d83beded7f6a2e0c919fedc" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "2348d2e1930835363dfade74cfc47d46c88e0691693f60e85cffc2d459ecf774" + }, + "model_config.json": { + "bytes": 7112, + "sha256": "a7539aaf67b322d787944dfd191feedc2b9373fb5958f763b171869578e41258" + }, + "norms.json": { + "bytes": 7840, + "sha256": "f39e579358c10911e79f2bfca2f38f76549e86462a4952ff68f009da0aca8118" + }, + "actuator_ranges.json": { + "bytes": 17917, + "sha256": "ccc717f12f66944e120b4a01dbf4ddd090c444ceff50a2613d0992a765b92a44" + }, + "provenance.json": { + "bytes": 1198, + "sha256": "47883a9d25d4a0ee5fb8e6d31464442420afbb59ecde6a4e7206f505848aec6d" + } + } + }, + { + "seed": 5, + "path": "s5", + "default": false, + "val_loss": 1.1122196558862925, + "seq_len": 256, + "files": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "1e10c13fc85dd992fafbaddc8b3dd01d11aabaf757e3e125329a699d298a6a11" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "bee461499d85d1cf7ce5b4f5f56ab1bf13b55066737c08147e860211b0091ff3" + }, + "model_config.json": { + "bytes": 7112, + "sha256": "77e00af4f5099967eb06c910400cb2ae892d097a9944b4e7e19751066bc0a2ca" + }, + "norms.json": { + "bytes": 7840, + "sha256": "f39e579358c10911e79f2bfca2f38f76549e86462a4952ff68f009da0aca8118" + }, + "actuator_ranges.json": { + "bytes": 17917, + "sha256": "ccc717f12f66944e120b4a01dbf4ddd090c444ceff50a2613d0992a765b92a44" + }, + "provenance.json": { + "bytes": 1198, + "sha256": "13204b19314a50bcb0e7228e79a9c64de4237bae6d6da4bd483a3ca4bdb3ebf4" + } + } + }, + { + "seed": 6, + "path": "s6", + "default": false, + "val_loss": 1.1161801163107157, + "seq_len": 256, + "files": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "36b55e194e705e0a1d1087c1164e4f72f2507784b1210a0ce2f94fa151db04fa" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "ca3570ae8e579c638d9195f6f7e3c4634bc61425cc51c7998a53818cb8c18ddb" + }, + "model_config.json": { + "bytes": 7112, + "sha256": "6107c3d463829d896ae229483595fe421f406925361774ff2b6e63bc9cf3ca40" + }, + "norms.json": { + "bytes": 7840, + "sha256": "f39e579358c10911e79f2bfca2f38f76549e86462a4952ff68f009da0aca8118" + }, + "actuator_ranges.json": { + "bytes": 17917, + "sha256": "ccc717f12f66944e120b4a01dbf4ddd090c444ceff50a2613d0992a765b92a44" + }, + "provenance.json": { + "bytes": 1198, + "sha256": "7cb93660689bffca0315d1bf5c1b1ffb2247b7c2e512cc0fdd9dc30037955140" + } + } + }, + { + "seed": 7, + "path": "s7", + "default": false, + "val_loss": 1.112956801429391, + "seq_len": 256, + "files": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "abf72130ad644f7bf2883c39f336536ad839ae7f609cc88d28a5366459e1693c" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "db040b029538d47b404e9864538fb0c550285081ecce7348ad6fd231fdd7bbcf" + }, + "model_config.json": { + "bytes": 7111, + "sha256": "7cfbcd1b3b9e50836dc7de9f312db9c70931afcc105dca1dd184d17c65f99d75" + }, + "norms.json": { + "bytes": 7840, + "sha256": "f39e579358c10911e79f2bfca2f38f76549e86462a4952ff68f009da0aca8118" + }, + "actuator_ranges.json": { + "bytes": 17917, + "sha256": "ccc717f12f66944e120b4a01dbf4ddd090c444ceff50a2613d0992a765b92a44" + }, + "provenance.json": { + "bytes": 1198, + "sha256": "687b3a1f6adfb5d4b2834bf1b5fc62f909dfdbb5812e81b82bef6784cef865f7" + } + } + } + ] +} diff --git a/s0/README.md b/s0/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2c6fda3fb4751ca0418a0775584a6a087dc058d0 --- /dev/null +++ b/s0/README.md @@ -0,0 +1,56 @@ +--- +license: mit +library_name: onnx +tags: + - onnx + - fusion + - plasma-physics + - tokamak + - diii-d + - mamba +--- + +# fuse29 — seed 0 + +**This is the champion seed and the default.** `Fuse29Predictor.from_pretrained()` with no seed argument loads it, and every number in the root model card refers to it. + +29-input Mamba-2 pedestal predictor for DIII-D. Raw physical units in, +physical units out. See the [root model card](https://huggingface.co/SCS-Lab/FUSE29-Pedestal-model) +for the full description, I/O contract, accuracy and limitations. + +| | | +|---|---| +| Seed | 0 | +| Parameters | 11,254,425 | +| Best validation loss | 1.1169 | +| Sequence graph length | 256 ticks | +| ONNX opset | 17 | +| Exported | 2026-09-03T00:46:21.979021+00:00 | +| Source checkpoint SHA-256 | `875ff7248c0bfde3…` | + +## Load + +```python +from fuse29.runtime import Fuse29Predictor + +predictor = Fuse29Predictor.from_pretrained("SCS-Lab/FUSE29-Pedestal-model", seed=0) +``` + +## Files + +| File | | +|---|---| +| `fuse29_step.onnx` | one 50 ms tick, carries state, no length limit | +| `fuse29_seq.onnx` | whole shot at a fixed 256 ticks | +| `model_config.json` | I/O contract: names, order, units, sources, shapes | +| `norms.json` | the statistics baked into the graphs | +| `actuator_ranges.json` | training-split distribution, for checking your units | +| `provenance.json` | source checkpoint hash, library versions, artefact hashes | + +## Before you use it + +- Four heads (`neped_prmtan`, `teped_prmtan`, `rho_sym`, `ne_top_loc`) are + **only valid in H-mode** and the graph does not gate them. Gate on the + model's own `hmode` output. +- `pinj` is in **MW**, not W. Run `predictor.check_units(shot)` once. +- Output column order is not alphabetical. See `model_config.json`. diff --git a/s0/actuator_ranges.json b/s0/actuator_ranges.json new file mode 100644 index 0000000000000000000000000000000000000000..08d19f4e80f49e6bbd18c40674b06946a02cc61a --- /dev/null +++ b/s0/actuator_ranges.json @@ -0,0 +1,600 @@ +{ + "schema_version": 1, + "note": "Physical-units distribution of each actuator over the training split. Use it to check that your signals are in the units the graph expects; a unit error is the one preprocessing mistake that produces confident nonsense rather than an exception.", + "split": "train", + "n_shots": 32731, + "n_ticks": 3020926, + "percentiles": [ + 0.1, + 1, + 5, + 25, + 50, + 75, + 95, + 99, + 99.9 + ], + "channels": { + "pinj": { + "units": "MW", + "source": "ptdata:bmspinj", + "description": "Neutral beam injected power, all sources.", + "min": -46005.02701919088, + "max": 17.512712760455507, + "mean": 3.838883638381958, + "std": 3.0613932609558105, + "pct": { + "0.1": -0.004132416388869853, + "1": 4.112187479421436e-09, + "5": 4.112187479421436e-09, + "25": 1.311169336894574, + "50": 3.18466408866965, + "75": 5.748764762873332, + "95": 9.841882532311711, + "99": 12.212702351352696, + "99.9": 14.791924355083399 + } + }, + "tinj": { + "units": "N*m", + "source": "ptdata:bmstinj", + "description": "Neutral beam injected torque, all sources.", + "min": -56.644382966354534, + "max": 129.9833380295058, + "mean": 2.2043209075927734, + "std": 2.11222505569458, + "pct": { + "0.1": -2.0636791725994676, + "1": -0.5384317586520496, + "5": -1.6338495756329507e-07, + "25": 0.4319133403840452, + "50": 1.963846077087278, + "75": 3.1821234334199193, + "95": 6.641525317445799, + "99": 8.941231792062355, + "99.9": 11.156712776956862 + } + }, + "ech_total": { + "units": "MW", + "source": "ptdata:ECHPWR", + "description": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "min": -19.31181996542309, + "max": 40.286455582885246, + "mean": 2.6981112957000732, + "std": 6.685519218444824, + "pct": { + "0.1": -1.0663586061709935, + "1": -0.09982622583332723, + "5": -0.020836448436920674, + "25": -3.2566890961760464e-08, + "50": -3.2566890961760464e-08, + "75": 1.1717011943616973, + "95": 21.558252060431304, + "99": 30.476182922859127, + "99.9": 37.09168917133024 + } + }, + "f1a": { + "units": "A", + "source": "ptdata:F1A", + "description": "Shaping F-coil F1A current (bank A).", + "min": -5776.925892871883, + "max": 5794.3504737288395, + "mean": -1382.3704833984375, + "std": 1349.629638671875, + "pct": { + "0.1": -4852.691808601986, + "1": -4131.456225748339, + "5": -3401.8604035239678, + "25": -2236.4754469921672, + "50": -1501.5458201268116, + "75": -660.4245966463927, + "95": 1294.4315819071094, + "99": 3103.250955923345, + "99.9": 4467.289606367005 + } + }, + "f2a": { + "units": "A", + "source": "ptdata:F2A", + "description": "Shaping F-coil F2A current (bank A).", + "min": -5716.347659616551, + "max": 5702.840977614059, + "mean": -1229.876708984375, + "std": 1248.3497314453125, + "pct": { + "0.1": -4093.397230708888, + "1": -3297.8668360449756, + "5": -2712.522533155646, + "25": -2004.455454331444, + "50": -1443.842241803098, + "75": -854.5004209979342, + "95": 1825.579117167513, + "99": 3097.0902901803724, + "99.9": 3899.548655232026 + } + }, + "f3a": { + "units": "A", + "source": "ptdata:F3A", + "description": "Shaping F-coil F3A current (bank A).", + "min": -5498.272347966228, + "max": 5321.719922394657, + "mean": -592.7352294921875, + "std": 1185.706298828125, + "pct": { + "0.1": -4140.690909683277, + "1": -3539.2136012211317, + "5": -2813.2888996278725, + "25": -1377.7435033975407, + "50": -152.16189816331342, + "75": 2.4453898354848604, + "95": 1203.107532773337, + "99": 2898.3184344684487, + "99.9": 3780.0556837479485 + } + }, + "f4a": { + "units": "A", + "source": "ptdata:F4A", + "description": "Shaping F-coil F4A current (bank A).", + "min": -5876.373800845117, + "max": 5855.700219305917, + "mean": 1098.1622314453125, + "std": 1368.95458984375, + "pct": { + "0.1": -4331.218505807293, + "1": -3344.4526378786877, + "5": -1858.4157962413597, + "25": 395.84891116184133, + "50": 1143.436262581068, + "75": 1990.2677717095535, + "95": 3141.5448401142426, + "99": 3756.430079500399, + "99.9": 4525.754910416766 + } + }, + "f5a": { + "units": "A", + "source": "ptdata:F5A", + "description": "Shaping F-coil F5A current (bank A).", + "min": -5178.8539079385355, + "max": 5353.141466672798, + "mean": 1173.57958984375, + "std": 1352.103759765625, + "pct": { + "0.1": -4592.7059148331355, + "1": -3597.7201189044818, + "5": -1551.4942446467403, + "25": 543.836095032849, + "50": 1273.969119983141, + "75": 2051.0443148459794, + "95": 3019.669622905384, + "99": 3875.454685744494, + "99.9": 4738.506855960392 + } + }, + "f6a": { + "units": "A", + "source": "ptdata:F6A", + "description": "Shaping F-coil F6A current (bank A).", + "min": -7929.903731492232, + "max": 5741.056818467809, + "mean": -2493.411865234375, + "std": 1867.8076171875, + "pct": { + "0.1": -6125.90268588119, + "1": -4963.398523516425, + "5": -4319.477588996284, + "25": -3574.8234234024885, + "50": -2898.635802832382, + "75": -2143.0930801744807, + "95": 2999.75903843203, + "99": 4137.6543157735705, + "99.9": 4783.375582166487 + } + }, + "f7a": { + "units": "A", + "source": "ptdata:F7A", + "description": "Shaping F-coil F7A current (bank A).", + "min": -9825.736080045011, + "max": 8678.484606762057, + "mean": -2367.570556640625, + "std": 1999.19970703125, + "pct": { + "0.1": -7676.219824168618, + "1": -6127.379912259545, + "5": -4909.893927511103, + "25": -3430.1309476786882, + "50": -2697.460342263373, + "75": -1913.0579478721388, + "95": 2723.164038733837, + "99": 3948.221013655396, + "99.9": 5316.086800760559 + } + }, + "f8a": { + "units": "A", + "source": "ptdata:F8A", + "description": "Shaping F-coil F8A current (bank A).", + "min": -5378.835169240788, + "max": 5880.767402237174, + "mean": 996.0214233398438, + "std": 1498.948974609375, + "pct": { + "0.1": -4229.744640827867, + "1": -3363.368412210415, + "5": -1922.2114690963926, + "25": 60.761390529545906, + "50": 1153.9241798399726, + "75": 1951.1572686642544, + "95": 3318.078493605748, + "99": 3973.7764489149104, + "99.9": 4670.296725684707 + } + }, + "f9a": { + "units": "A", + "source": "ptdata:F9A", + "description": "Shaping F-coil F9A current (bank A).", + "min": -7206.032812499594, + "max": 8700.684616308497, + "mean": -535.8018798828125, + "std": 1258.01171875, + "pct": { + "0.1": -4739.927394914494, + "1": -3344.557163847978, + "5": -2567.420669960383, + "25": -1538.6304412830955, + "50": -578.9736547563273, + "75": 353.08467764596537, + "95": 1558.2607279613098, + "99": 2657.691791383836, + "99.9": 4334.930796170508 + } + }, + "f1b": { + "units": "A", + "source": "ptdata:F1B", + "description": "Shaping F-coil F1B current (bank B).", + "min": -5921.943154546981, + "max": 5407.326196618229, + "mean": -1373.1888427734375, + "std": 1367.82275390625, + "pct": { + "0.1": -5179.567735964654, + "1": -4339.478258925401, + "5": -3463.431883510691, + "25": -2205.922070942479, + "50": -1459.5306304510002, + "75": -750.1948036110768, + "95": 1428.796834935177, + "99": 3233.0438718527407, + "99.9": 4240.724502122051 + } + }, + "f2b": { + "units": "A", + "source": "ptdata:F2B", + "description": "Shaping F-coil F2B current (bank B).", + "min": -5788.286812358208, + "max": 5428.562849130928, + "mean": -1218.50048828125, + "std": 1316.67724609375, + "pct": { + "0.1": -4785.998935671587, + "1": -3520.521383204173, + "5": -2855.1671089762676, + "25": -1969.483606794242, + "50": -1447.1879016413761, + "75": -866.6265611311096, + "95": 2049.217650390811, + "99": 3312.4349928765846, + "99.9": 4011.5142868858347 + } + }, + "f3b": { + "units": "A", + "source": "ptdata:F3B", + "description": "Shaping F-coil F3B current (bank B).", + "min": -5503.943071765381, + "max": 4849.177948074737, + "mean": -1005.3848266601562, + "std": 1308.8258056640625, + "pct": { + "0.1": -4452.6277480541985, + "1": -3641.634707712471, + "5": -2937.4861003450947, + "25": -1881.7475544966392, + "50": -1170.6945714968547, + "75": -124.13671681902403, + "95": 1683.5400540223286, + "99": 3015.8060365193123, + "99.9": 3797.6599244161957 + } + }, + "f4b": { + "units": "A", + "source": "ptdata:F4B", + "description": "Shaping F-coil F4B current (bank B).", + "min": -5829.242194941551, + "max": 5787.149431930685, + "mean": 1124.2967529296875, + "std": 1519.5994873046875, + "pct": { + "0.1": -4083.976449898858, + "1": -3247.08251902718, + "5": -2270.942268479742, + "25": 376.8608226937906, + "50": 1392.450441038166, + "75": 2146.7001303629104, + "95": 3145.5476189867913, + "99": 3926.614817946318, + "99.9": 4582.551950710075 + } + }, + "f5b": { + "units": "A", + "source": "ptdata:F5B", + "description": "Shaping F-coil F5B current (bank B).", + "min": -5213.110339059254, + "max": 5388.213772287713, + "mean": 1443.536865234375, + "std": 1408.3306884765625, + "pct": { + "0.1": -4134.61747806435, + "1": -3056.873937432705, + "5": -1361.0988601293998, + "25": 675.1515533174199, + "50": 1572.802070225599, + "75": 2367.5452263604984, + "95": 3528.863240540377, + "99": 4411.454242162536, + "99.9": 4967.30642206674 + } + }, + "f6b": { + "units": "A", + "source": "ptdata:F6B", + "description": "Shaping F-coil F6B current (bank B).", + "min": -7604.653108484432, + "max": 7763.1261416792295, + "mean": -2463.248046875, + "std": 1836.4208984375, + "pct": { + "0.1": -6372.627428710043, + "1": -5251.4106280007745, + "5": -4318.157196234368, + "25": -3524.5849152058445, + "50": -2837.2759930056304, + "75": -2089.94465303326, + "95": 2871.6849973390945, + "99": 3948.010461650111, + "99.9": 4803.251616324593 + } + }, + "f7b": { + "units": "A", + "source": "ptdata:F7B", + "description": "Shaping F-coil F7B current (bank B).", + "min": -11380.254539563213, + "max": 9414.242772782009, + "mean": -2941.56005859375, + "std": 2510.1083984375, + "pct": { + "0.1": -9236.286164628174, + "1": -7962.01372128499, + "5": -6618.689743738845, + "25": -4397.68407591947, + "50": -3041.7944101983817, + "75": -2113.0768216001165, + "95": 2850.240503964187, + "99": 5238.131223534479, + "99.9": 6771.41582857779 + } + }, + "f8b": { + "units": "A", + "source": "ptdata:F8B", + "description": "Shaping F-coil F8B current (bank B).", + "min": -5834.457886045129, + "max": 5952.292180058913, + "mean": 1431.05615234375, + "std": 1718.2965087890625, + "pct": { + "0.1": -4377.886849186064, + "1": -3547.8568327724756, + "5": -2536.325388000092, + "25": 592.1441487378677, + "50": 1743.1741236182588, + "75": 2613.9050347435855, + "95": 3655.019608301406, + "99": 4295.252919476556, + "99.9": 5183.621783504976 + } + }, + "f9b": { + "units": "A", + "source": "ptdata:F9B", + "description": "Shaping F-coil F9B current (bank B).", + "min": -7298.33418485197, + "max": 8673.475372842513, + "mean": -214.02586364746094, + "std": 1388.83447265625, + "pct": { + "0.1": -4443.002941036773, + "1": -3335.961239603393, + "5": -2530.3434455144015, + "25": -1111.6205754278508, + "50": -212.41719832099042, + "75": 564.1401009862525, + "95": 2296.158459733251, + "99": 3401.023805016151, + "99.9": 4981.695296538042 + } + }, + "ecoila": { + "units": "A", + "source": "ptdata:ECOILA", + "description": "Ohmic E-coil bank A current.", + "min": -68526.67779690563, + "max": 65669.33446503483, + "mean": -6965.32666015625, + "std": 18940.9453125, + "pct": { + "0.1": -62521.0592220894, + "1": -53449.0677376177, + "5": -39610.65329064206, + "25": -19599.348704727538, + "50": -6887.604056684089, + "75": 6065.040591650557, + "95": 23926.96154448237, + "99": 33650.27142286909, + "99.9": 48164.54971213867 + } + }, + "ecoilb": { + "units": "A", + "source": "ptdata:ECOILB", + "description": "Ohmic E-coil bank B current.", + "min": -67880.78461590248, + "max": 67380.80764904841, + "mean": -6876.16455078125, + "std": 18723.662109375, + "pct": { + "0.1": -61839.528701402356, + "1": -52787.079189397904, + "5": -39153.2527665565, + "25": -19383.82435886666, + "50": -6768.996463787789, + "75": 6013.297288247475, + "95": 23686.641557508636, + "99": 33187.653018934754, + "99.9": 47362.43837391052 + } + }, + "gasa_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "description": "Calibrated gas injection flow, valve A.", + "min": -0.9805486760911233, + "max": 348.1779045740827, + "mean": 15.054444313049316, + "std": 26.369497299194336, + "pct": { + "0.1": -0.0181447514768128, + "1": 0.0006228885411054819, + "5": 0.0014589414841879034, + "25": 0.00852798057103854, + "50": 0.09974314587981326, + "75": 19.645558552678416, + "95": 71.02669389337856, + "99": 137.36341388263276, + "99.9": 211.79616738152396 + } + }, + "gasb_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "description": "Calibrated gas injection flow, valve B.", + "min": -0.5231055139632899, + "max": 317.69717326145866, + "mean": 1.386172890663147, + "std": 3.4090511798858643, + "pct": { + "0.1": 9.14047308575583e-06, + "1": 0.0007714573310613204, + "5": 0.002068321612864521, + "25": 0.009055124211873267, + "50": 0.07339015461169385, + "75": 1.9421402622606716, + "95": 1.9421402622606716, + "99": 23.663863921838843, + "99.9": 149.40068998150738 + } + }, + "gasc_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "description": "Calibrated gas injection flow, valve C.", + "min": -0.3965804467767108, + "max": 306.0269668007428, + "mean": 0.35034820437431335, + "std": 0.4470684826374054, + "pct": { + "0.1": 7.428448363699935e-05, + "1": 0.00026770734685732656, + "5": 0.0006667805693404416, + "25": 0.002788385500787083, + "50": 0.023577950502740697, + "75": 0.7508911827356307, + "95": 0.7508911827356307, + "99": 2.733332630282, + "99.9": 108.67323889612304 + } + }, + "gasd_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "description": "Calibrated gas injection flow, valve D.", + "min": -0.5287260135880842, + "max": 771.5043798529183, + "mean": 0.528103232383728, + "std": 0.654624342918396, + "pct": { + "0.1": 5.497087182604332e-05, + "1": 0.000175335120693898, + "5": 0.0005482846440516553, + "25": 0.003719433481388368, + "50": 0.08385269566973214, + "75": 1.0383906373403984, + "95": 1.0383906373403984, + "99": 4.359676988215197, + "99.9": 127.54440071212512 + } + }, + "gase_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "description": "Calibrated gas injection flow, valve E.", + "min": -0.2211384331710633, + "max": 672.8582070151267, + "mean": 0.27696067094802856, + "std": 0.17616958916187286, + "pct": { + "0.1": 0.00010156410138473793, + "1": 0.000223585566083373, + "5": 0.0005190716405260032, + "25": 0.011627604901727706, + "50": 0.3920832239686922, + "75": 0.3920832239686922, + "95": 0.3920832239686922, + "99": 0.3920832239686922, + "99.9": 29.75536079519976 + } + }, + "bt": { + "units": "T", + "source": "ptdata:bt", + "description": "Vacuum toroidal magnetic field (signed).", + "min": -2.2353815075115375, + "max": 2.25186423641397, + "mean": -0.971906840801239, + "std": 1.6484158039093018, + "pct": { + "0.1": -2.2151064134142304, + "1": -2.1819873443702726, + "5": -2.136304350652244, + "25": -2.0446028795017246, + "50": -1.8984274308309796, + "75": -1.0260122281948352, + "95": 2.053318112027725, + "99": 2.10945640328767, + "99.9": 2.1819705410137904 + } + } + } +} diff --git a/s0/fuse29_seq.onnx b/s0/fuse29_seq.onnx new file mode 100644 index 0000000000000000000000000000000000000000..f1d1901f52816fdc8e4d60269353b2c6e5ffd493 --- /dev/null +++ b/s0/fuse29_seq.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0274ad98cc51ee938422f3c9febd3c3cf3141a35d39ff2a62efeb75f9ce43577 +size 45464382 diff --git a/s0/fuse29_step.onnx b/s0/fuse29_step.onnx new file mode 100644 index 0000000000000000000000000000000000000000..1200f8963532a686db07d5ef2539054cc5bf188b --- /dev/null +++ b/s0/fuse29_step.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9150698ab06af368eec857ea429191bf8a0593e9fd9d7e571bb7ce5bcbcf853a +size 45081271 diff --git a/s0/model_config.json b/s0/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..a44d0231afbbe05d465efb21b6c04f423b707b04 --- /dev/null +++ b/s0/model_config.json @@ -0,0 +1,268 @@ +{ + "schema_version": 1, + "model": "fuse29", + "seed": 0, + "description": "29-input Mamba-2 pedestal predictor for DIII-D. Strictly causal, 20 Hz, nine heads at rho_tor = 0.85.", + "architecture": { + "family": "Mamba-2 (structured state-space duality)", + "d_model": 512, + "n_layers": 6, + "d_state": 128, + "d_conv": 4, + "expand": 2, + "headdim": 128, + "nheads": 8, + "ngroups": 2, + "chunk_size": 100, + "d_inner": 1024, + "conv_dim": 1536, + "n_params": 11254425 + }, + "cadence": { + "hz": 20, + "period_ms": 50.0, + "rho_tor": 0.85 + }, + "inputs": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "n": 29, + "units": { + "pinj": "MW", + "tinj": "N*m", + "ech_total": "MW", + "f1a": "A", + "f2a": "A", + "f3a": "A", + "f4a": "A", + "f5a": "A", + "f6a": "A", + "f7a": "A", + "f8a": "A", + "f9a": "A", + "f1b": "A", + "f2b": "A", + "f3b": "A", + "f4b": "A", + "f5b": "A", + "f6b": "A", + "f7b": "A", + "f8b": "A", + "f9b": "A", + "ecoila": "A", + "ecoilb": "A", + "gasa_cal": "Torr*L/s", + "gasb_cal": "Torr*L/s", + "gasc_cal": "Torr*L/s", + "gasd_cal": "Torr*L/s", + "gase_cal": "Torr*L/s", + "bt": "T" + }, + "sources": { + "pinj": "ptdata:bmspinj", + "tinj": "ptdata:bmstinj", + "ech_total": "ptdata:ECHPWR", + "f1a": "ptdata:F1A", + "f2a": "ptdata:F2A", + "f3a": "ptdata:F3A", + "f4a": "ptdata:F4A", + "f5a": "ptdata:F5A", + "f6a": "ptdata:F6A", + "f7a": "ptdata:F7A", + "f8a": "ptdata:F8A", + "f9a": "ptdata:F9A", + "f1b": "ptdata:F1B", + "f2b": "ptdata:F2B", + "f3b": "ptdata:F3B", + "f4b": "ptdata:F4B", + "f5b": "ptdata:F5B", + "f6b": "ptdata:F6B", + "f7b": "ptdata:F7B", + "f8b": "ptdata:F8B", + "f9b": "ptdata:F9B", + "ecoila": "ptdata:ECOILA", + "ecoilb": "ptdata:ECOILB", + "gasa_cal": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "gasb_cal": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "gasc_cal": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "gasd_cal": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "gase_cal": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "bt": "ptdata:bt" + }, + "descriptions": { + "pinj": "Neutral beam injected power, all sources.", + "tinj": "Neutral beam injected torque, all sources.", + "ech_total": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "f1a": "Shaping F-coil F1A current (bank A).", + "f2a": "Shaping F-coil F2A current (bank A).", + "f3a": "Shaping F-coil F3A current (bank A).", + "f4a": "Shaping F-coil F4A current (bank A).", + "f5a": "Shaping F-coil F5A current (bank A).", + "f6a": "Shaping F-coil F6A current (bank A).", + "f7a": "Shaping F-coil F7A current (bank A).", + "f8a": "Shaping F-coil F8A current (bank A).", + "f9a": "Shaping F-coil F9A current (bank A).", + "f1b": "Shaping F-coil F1B current (bank B).", + "f2b": "Shaping F-coil F2B current (bank B).", + "f3b": "Shaping F-coil F3B current (bank B).", + "f4b": "Shaping F-coil F4B current (bank B).", + "f5b": "Shaping F-coil F5B current (bank B).", + "f6b": "Shaping F-coil F6B current (bank B).", + "f7b": "Shaping F-coil F7B current (bank B).", + "f8b": "Shaping F-coil F8B current (bank B).", + "f9b": "Shaping F-coil F9B current (bank B).", + "ecoila": "Ohmic E-coil bank A current.", + "ecoilb": "Ohmic E-coil bank B current.", + "gasa_cal": "Calibrated gas injection flow, valve A.", + "gasb_cal": "Calibrated gas injection flow, valve B.", + "gasc_cal": "Calibrated gas injection flow, valve C.", + "gasd_cal": "Calibrated gas injection flow, valve D.", + "gase_cal": "Calibrated gas injection flow, valve E.", + "bt": "Vacuum toroidal magnetic field (signed)." + }, + "space": "raw physical units; the graph applies the z-score", + "note": "Check your units against actuator_ranges.json before trusting any output. A unit error produces confident nonsense rather than an exception." + }, + "outputs": { + "names": [ + "ne", + "te_ped", + "ti_ped", + "t_rot_ped", + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc", + "hmode" + ], + "n": 9, + "units": { + "ne": "1e19 m^-3", + "te_ped": "keV", + "ti_ped": "keV", + "t_rot_ped": "krad/s", + "neped_prmtan": "1e19 m^-3", + "teped_prmtan": "keV", + "rho_sym": "rho_tor (dimensionless)", + "ne_top_loc": "rho_tor (dimensionless)", + "hmode": "probability in [0, 1]" + }, + "note": "Physical units. hmode is a probability in [0, 1]; the graph applies the sigmoid.", + "hmode_gated": { + "heads": [ + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc" + ], + "indices": [ + 4, + 5, + 6, + 7 + ], + "threshold": 0.5, + "note": "These four heads were trained only on H-mode rows and are undefined otherwise. The graph does NOT gate them; the consumer must, using the model's own hmode output. See docs/GATING.md." + } + }, + "graphs": { + "fuse29_step.onnx": { + "purpose": "real-time, one 50 ms tick per call", + "inputs": { + "actuators": [ + "batch", + 29 + ], + "conv_state": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "outputs": { + "predictions": [ + "batch", + 9 + ], + "conv_state_out": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state_out": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "initial_state": "all zeros at the start of a shot", + "max_shot_length": "unbounded" + }, + "fuse29_seq.onnx": { + "purpose": "offline scoring of a whole shot", + "inputs": { + "actuators": [ + "batch", + 256, + 29 + ] + }, + "outputs": { + "predictions": [ + "batch", + 256, + 9 + ] + }, + "seq_len": 256, + "note": "Sequence length is FIXED. Right-pad shorter shots with zeros and read the first T outputs; the model is strictly causal so this is exact. For longer shots use the step graph or re-export with --seq-len." + } + }, + "dtype": "float32", + "onnx_opset": 17, + "training": { + "epoch": 19, + "val_loss": 1.1169083155691624, + "note": "See docs/TRAINING.md for the full recipe." + } +} diff --git a/s0/norms.json b/s0/norms.json new file mode 100644 index 0000000000000000000000000000000000000000..98c8c06209fd050ed78c21fa5b30afd95a71c171 --- /dev/null +++ b/s0/norms.json @@ -0,0 +1,292 @@ +{ + "schema_version": 2, + "note": "Statistics are baked into the shipped ONNX graphs. This file is for inspection and for reproducing the transform outside the graph; it is not required at inference time.", + "actuator_space": "physical", + "std_floor": 1e-06, + "clip_sigma": 20.0, + "provenance": { + "split": "train", + "n_shots": 32731, + "rho_index": 85, + "source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85, random stratified split (split_index.json)", + "note": "Recomputed on the NEW random train split. The source shards carried z-scores from the OLD chronological train split, whose shots overlap our test set. Actuator statistics are winsorised so a corrupted sample cannot set a channel's divisor.", + "inflated_channels": [ + "pinj", + "gasc_cal", + "gasd_cal", + "gase_cal" + ], + "actuator_estimator": "winsorised to p1..p99", + "actuator_space": "physical", + "composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "composition": "z = (x_phys - (m1 + s1*m2)) / (s1*s2), where (m1, s1) is the upstream FPE z-score and (m2, s2) is this model's re-scale onto its own training split" + }, + "actuators": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "mean": [ + 3.838883638381958, + 2.2043209075927734, + 2.6981112957000732, + -1382.3704833984375, + -1229.876708984375, + -592.7352294921875, + 1098.1622314453125, + 1173.57958984375, + -2493.411865234375, + -2367.570556640625, + 996.0214233398438, + -535.8018798828125, + -1373.1888427734375, + -1218.50048828125, + -1005.3848266601562, + 1124.2967529296875, + 1443.536865234375, + -2463.248046875, + -2941.56005859375, + 1431.05615234375, + -214.02586364746094, + -6965.32666015625, + -6876.16455078125, + 15.054444313049316, + 1.386172890663147, + 0.35034820437431335, + 0.528103232383728, + 0.27696067094802856, + -0.971906840801239 + ], + "std": [ + 3.0613932609558105, + 2.11222505569458, + 6.685519218444824, + 1349.629638671875, + 1248.3497314453125, + 1185.706298828125, + 1368.95458984375, + 1352.103759765625, + 1867.8076171875, + 1999.19970703125, + 1498.948974609375, + 1258.01171875, + 1367.82275390625, + 1316.67724609375, + 1308.8258056640625, + 1519.5994873046875, + 1408.3306884765625, + 1836.4208984375, + 2510.1083984375, + 1718.2965087890625, + 1388.83447265625, + 18940.9453125, + 18723.662109375, + 26.369497299194336, + 3.4090511798858643, + 0.4470684826374054, + 0.654624342918396, + 0.17616958916187286, + 1.6484158039093018 + ], + "transform": "z = clip((x - mean) / std, -clip_sigma, +clip_sigma), applied inside the graph" + }, + "targets": { + "ne": { + "mean": 2.7511744499206543, + "std": 1.654153823852539 + }, + "te_ped": { + "mean": 0.5915626287460327, + "std": 0.43467429280281067 + }, + "ti_ped": { + "mean": 1.016850233078003, + "std": 0.681096076965332 + }, + "t_rot_ped": { + "mean": 21.244613647460938, + "std": 16.59148406982422 + }, + "neped_prmtan": { + "mean": 2.7231285572052, + "std": 1.7005536556243896 + }, + "teped_prmtan": { + "mean": 0.46375223994255066, + "std": 0.36919456720352173 + }, + "rho_sym": { + "mean": 0.9757616519927979, + "std": 0.04329206794500351 + }, + "ne_top_loc": { + "mean": 0.9261865019798279, + "std": 0.049897171556949615 + } + }, + "hmode": { + "transform": "sigmoid", + "note": "hmode is a logit in the trunk; the graph applies the sigmoid." + }, + "stages": { + "note": "The composed actuator statistics above are the product of these two. Shown for traceability; use the composed values.", + "stage1_physical_to_fpe_zscore": { + "mean": [ + 2.8111997039100878, + 2.154143940948575, + 2.159654935239209, + -1444.0438445123289, + -1315.1185221229061, + -639.741760304047, + 1172.4978680515835, + 1222.4970107268077, + -2488.8410961768263, + -2491.3739557685253, + 1050.107386405324, + -578.9736547563273, + -1421.0817159358041, + -1285.3967398730092, + -1061.0290851406676, + 1186.4795970820587, + 1460.6822372728345, + -2452.093120847959, + -3071.3132492215186, + 1531.3304960724108, + -262.6728625067526, + -6887.604056684089, + -6768.996463787789, + 14.89178144369171, + 1.9421402622606716, + 0.7508911827356307, + 1.0383906373403984, + 0.3920832239686922, + -1.0310375752078498 + ], + "std": [ + 194.08418888726106, + 2.3684465859740262, + 5.948083564785035, + 1267.4907621702682, + 1217.4478106828162, + 1249.3915272640536, + 1345.3871181128568, + 1359.1934832307923, + 1887.1891497052302, + 1888.1014577442652, + 1559.9875106371376, + 1287.2118470203372, + 1271.813282654729, + 1259.8644805335082, + 1361.9306367877398, + 1521.172083160852, + 1393.2120473032558, + 1856.723912629122, + 2432.8530409799628, + 1705.6959050005082, + 1421.8036451037203, + 19092.148992270486, + 18858.28389193975, + 27.289184462156058, + 11.092415079529571, + 9.017289768908354, + 12.055982101097918, + 6.498888909025979, + 1.599000778986496 + ] + }, + "stage2_fpe_zscore_to_model": { + "mean": [ + 0.0052950419485569, + 0.02118559367954731, + 0.0905260294675827, + 0.04865782707929611, + 0.0700167864561081, + 0.03762352466583252, + -0.05525219440460205, + -0.03599006310105324, + -0.002421961398795247, + 0.06557027250528336, + -0.03467077016830444, + 0.03353898227214813, + 0.03765711933374405, + 0.05309795215725899, + 0.040856875479221344, + -0.04087827727198601, + -0.012306398712098598, + -0.006007813848555088, + 0.05333370715379715, + -0.05878793075680733, + 0.03421499580144882, + -0.004070908762514591, + -0.00568280229344964, + 0.005960696842521429, + -0.050121404230594635, + -0.04441944137215614, + -0.042326491326093674, + -0.017714189365506172, + 0.036979787051677704 + ], + "std": [ + 0.015773532912135124, + 0.8918187022209167, + 1.1239787340164185, + 1.0648043155670166, + 1.0253825187683105, + 0.9490270018577576, + 1.0175172090530396, + 0.994783878326416, + 0.9897299408912659, + 1.0588412284851074, + 0.9608724117279053, + 0.9773152470588684, + 1.0754902362823486, + 1.04509437084198, + 0.9610077142715454, + 0.9989661574363708, + 1.0108516216278076, + 0.9890651702880859, + 1.0317550897598267, + 1.007387399673462, + 0.9768117070198059, + 0.9920803308486938, + 0.9928614497184753, + 0.9662984609603882, + 0.30733174085617065, + 0.04957903176546097, + 0.05429871752858162, + 0.02710764855146408, + 1.030903697013855 + ] + } + } +} diff --git a/s0/provenance.json b/s0/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..1dd5b8fed3e962f06ce33ca13d390154d7e0803c --- /dev/null +++ b/s0/provenance.json @@ -0,0 +1,32 @@ +{ + "schema_version": 1, + "exported_utc": "2026-09-03T00:46:21.979021+00:00", + "seed": 0, + "source_checkpoint": "/flare/fusiondl_aesp/fuse_bd_model/fuse20/runs/fuse29r_s0/best_model.pt", + "source_checkpoint_sha256": "875ff7248c0bfde39c54e75d4638bd563f8f78b52dc26e294cdd308b116d13c7", + "norms_source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json", + "norms_actuator_space": "physical", + "norms_composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "onnx_opset": 17, + "exporter": "torch.onnx.export (TorchScript, dynamo=False)", + "versions": { + "torch": "2.10.0a0+git449b176", + "python": "3.12.12", + "platform": "Linux-5.14.21-150400.24.235-default-x86_64-with-glibc2.31", + "onnx": "1.22.0", + "onnxruntime": "1.29.0" + }, + "artifacts": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "9150698ab06af368eec857ea429191bf8a0593e9fd9d7e571bb7ce5bcbcf853a" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "0274ad98cc51ee938422f3c9febd3c3cf3141a35d39ff2a62efeb75f9ce43577" + } + } +} diff --git a/s1/README.md b/s1/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1b5251b716f95e4ad90c53af34e0db4032e369c7 --- /dev/null +++ b/s1/README.md @@ -0,0 +1,56 @@ +--- +license: mit +library_name: onnx +tags: + - onnx + - fusion + - plasma-physics + - tokamak + - diii-d + - mamba +--- + +# fuse29 — seed 1 + +This is seed 1, one of eight independently trained runs. Seed 0 is the champion and the default; this one exists so you can measure spread across training runs. Unless you are doing that, you want seed 0. + +29-input Mamba-2 pedestal predictor for DIII-D. Raw physical units in, +physical units out. See the [root model card](https://huggingface.co/SCS-Lab/FUSE29-Pedestal-model) +for the full description, I/O contract, accuracy and limitations. + +| | | +|---|---| +| Seed | 1 | +| Parameters | 11,254,425 | +| Best validation loss | 1.1129 | +| Sequence graph length | 256 ticks | +| ONNX opset | 17 | +| Exported | 2026-09-03T00:46:24.670692+00:00 | +| Source checkpoint SHA-256 | `a77e8a7359c47e1f…` | + +## Load + +```python +from fuse29.runtime import Fuse29Predictor + +predictor = Fuse29Predictor.from_pretrained("SCS-Lab/FUSE29-Pedestal-model", seed=1) +``` + +## Files + +| File | | +|---|---| +| `fuse29_step.onnx` | one 50 ms tick, carries state, no length limit | +| `fuse29_seq.onnx` | whole shot at a fixed 256 ticks | +| `model_config.json` | I/O contract: names, order, units, sources, shapes | +| `norms.json` | the statistics baked into the graphs | +| `actuator_ranges.json` | training-split distribution, for checking your units | +| `provenance.json` | source checkpoint hash, library versions, artefact hashes | + +## Before you use it + +- Four heads (`neped_prmtan`, `teped_prmtan`, `rho_sym`, `ne_top_loc`) are + **only valid in H-mode** and the graph does not gate them. Gate on the + model's own `hmode` output. +- `pinj` is in **MW**, not W. Run `predictor.check_units(shot)` once. +- Output column order is not alphabetical. See `model_config.json`. diff --git a/s1/actuator_ranges.json b/s1/actuator_ranges.json new file mode 100644 index 0000000000000000000000000000000000000000..08d19f4e80f49e6bbd18c40674b06946a02cc61a --- /dev/null +++ b/s1/actuator_ranges.json @@ -0,0 +1,600 @@ +{ + "schema_version": 1, + "note": "Physical-units distribution of each actuator over the training split. Use it to check that your signals are in the units the graph expects; a unit error is the one preprocessing mistake that produces confident nonsense rather than an exception.", + "split": "train", + "n_shots": 32731, + "n_ticks": 3020926, + "percentiles": [ + 0.1, + 1, + 5, + 25, + 50, + 75, + 95, + 99, + 99.9 + ], + "channels": { + "pinj": { + "units": "MW", + "source": "ptdata:bmspinj", + "description": "Neutral beam injected power, all sources.", + "min": -46005.02701919088, + "max": 17.512712760455507, + "mean": 3.838883638381958, + "std": 3.0613932609558105, + "pct": { + "0.1": -0.004132416388869853, + "1": 4.112187479421436e-09, + "5": 4.112187479421436e-09, + "25": 1.311169336894574, + "50": 3.18466408866965, + "75": 5.748764762873332, + "95": 9.841882532311711, + "99": 12.212702351352696, + "99.9": 14.791924355083399 + } + }, + "tinj": { + "units": "N*m", + "source": "ptdata:bmstinj", + "description": "Neutral beam injected torque, all sources.", + "min": -56.644382966354534, + "max": 129.9833380295058, + "mean": 2.2043209075927734, + "std": 2.11222505569458, + "pct": { + "0.1": -2.0636791725994676, + "1": -0.5384317586520496, + "5": -1.6338495756329507e-07, + "25": 0.4319133403840452, + "50": 1.963846077087278, + "75": 3.1821234334199193, + "95": 6.641525317445799, + "99": 8.941231792062355, + "99.9": 11.156712776956862 + } + }, + "ech_total": { + "units": "MW", + "source": "ptdata:ECHPWR", + "description": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "min": -19.31181996542309, + "max": 40.286455582885246, + "mean": 2.6981112957000732, + "std": 6.685519218444824, + "pct": { + "0.1": -1.0663586061709935, + "1": -0.09982622583332723, + "5": -0.020836448436920674, + "25": -3.2566890961760464e-08, + "50": -3.2566890961760464e-08, + "75": 1.1717011943616973, + "95": 21.558252060431304, + "99": 30.476182922859127, + "99.9": 37.09168917133024 + } + }, + "f1a": { + "units": "A", + "source": "ptdata:F1A", + "description": "Shaping F-coil F1A current (bank A).", + "min": -5776.925892871883, + "max": 5794.3504737288395, + "mean": -1382.3704833984375, + "std": 1349.629638671875, + "pct": { + "0.1": -4852.691808601986, + "1": -4131.456225748339, + "5": -3401.8604035239678, + "25": -2236.4754469921672, + "50": -1501.5458201268116, + "75": -660.4245966463927, + "95": 1294.4315819071094, + "99": 3103.250955923345, + "99.9": 4467.289606367005 + } + }, + "f2a": { + "units": "A", + "source": "ptdata:F2A", + "description": "Shaping F-coil F2A current (bank A).", + "min": -5716.347659616551, + "max": 5702.840977614059, + "mean": -1229.876708984375, + "std": 1248.3497314453125, + "pct": { + "0.1": -4093.397230708888, + "1": -3297.8668360449756, + "5": -2712.522533155646, + "25": -2004.455454331444, + "50": -1443.842241803098, + "75": -854.5004209979342, + "95": 1825.579117167513, + "99": 3097.0902901803724, + "99.9": 3899.548655232026 + } + }, + "f3a": { + "units": "A", + "source": "ptdata:F3A", + "description": "Shaping F-coil F3A current (bank A).", + "min": -5498.272347966228, + "max": 5321.719922394657, + "mean": -592.7352294921875, + "std": 1185.706298828125, + "pct": { + "0.1": -4140.690909683277, + "1": -3539.2136012211317, + "5": -2813.2888996278725, + "25": -1377.7435033975407, + "50": -152.16189816331342, + "75": 2.4453898354848604, + "95": 1203.107532773337, + "99": 2898.3184344684487, + "99.9": 3780.0556837479485 + } + }, + "f4a": { + "units": "A", + "source": "ptdata:F4A", + "description": "Shaping F-coil F4A current (bank A).", + "min": -5876.373800845117, + "max": 5855.700219305917, + "mean": 1098.1622314453125, + "std": 1368.95458984375, + "pct": { + "0.1": -4331.218505807293, + "1": -3344.4526378786877, + "5": -1858.4157962413597, + "25": 395.84891116184133, + "50": 1143.436262581068, + "75": 1990.2677717095535, + "95": 3141.5448401142426, + "99": 3756.430079500399, + "99.9": 4525.754910416766 + } + }, + "f5a": { + "units": "A", + "source": "ptdata:F5A", + "description": "Shaping F-coil F5A current (bank A).", + "min": -5178.8539079385355, + "max": 5353.141466672798, + "mean": 1173.57958984375, + "std": 1352.103759765625, + "pct": { + "0.1": -4592.7059148331355, + "1": -3597.7201189044818, + "5": -1551.4942446467403, + "25": 543.836095032849, + "50": 1273.969119983141, + "75": 2051.0443148459794, + "95": 3019.669622905384, + "99": 3875.454685744494, + "99.9": 4738.506855960392 + } + }, + "f6a": { + "units": "A", + "source": "ptdata:F6A", + "description": "Shaping F-coil F6A current (bank A).", + "min": -7929.903731492232, + "max": 5741.056818467809, + "mean": -2493.411865234375, + "std": 1867.8076171875, + "pct": { + "0.1": -6125.90268588119, + "1": -4963.398523516425, + "5": -4319.477588996284, + "25": -3574.8234234024885, + "50": -2898.635802832382, + "75": -2143.0930801744807, + "95": 2999.75903843203, + "99": 4137.6543157735705, + "99.9": 4783.375582166487 + } + }, + "f7a": { + "units": "A", + "source": "ptdata:F7A", + "description": "Shaping F-coil F7A current (bank A).", + "min": -9825.736080045011, + "max": 8678.484606762057, + "mean": -2367.570556640625, + "std": 1999.19970703125, + "pct": { + "0.1": -7676.219824168618, + "1": -6127.379912259545, + "5": -4909.893927511103, + "25": -3430.1309476786882, + "50": -2697.460342263373, + "75": -1913.0579478721388, + "95": 2723.164038733837, + "99": 3948.221013655396, + "99.9": 5316.086800760559 + } + }, + "f8a": { + "units": "A", + "source": "ptdata:F8A", + "description": "Shaping F-coil F8A current (bank A).", + "min": -5378.835169240788, + "max": 5880.767402237174, + "mean": 996.0214233398438, + "std": 1498.948974609375, + "pct": { + "0.1": -4229.744640827867, + "1": -3363.368412210415, + "5": -1922.2114690963926, + "25": 60.761390529545906, + "50": 1153.9241798399726, + "75": 1951.1572686642544, + "95": 3318.078493605748, + "99": 3973.7764489149104, + "99.9": 4670.296725684707 + } + }, + "f9a": { + "units": "A", + "source": "ptdata:F9A", + "description": "Shaping F-coil F9A current (bank A).", + "min": -7206.032812499594, + "max": 8700.684616308497, + "mean": -535.8018798828125, + "std": 1258.01171875, + "pct": { + "0.1": -4739.927394914494, + "1": -3344.557163847978, + "5": -2567.420669960383, + "25": -1538.6304412830955, + "50": -578.9736547563273, + "75": 353.08467764596537, + "95": 1558.2607279613098, + "99": 2657.691791383836, + "99.9": 4334.930796170508 + } + }, + "f1b": { + "units": "A", + "source": "ptdata:F1B", + "description": "Shaping F-coil F1B current (bank B).", + "min": -5921.943154546981, + "max": 5407.326196618229, + "mean": -1373.1888427734375, + "std": 1367.82275390625, + "pct": { + "0.1": -5179.567735964654, + "1": -4339.478258925401, + "5": -3463.431883510691, + "25": -2205.922070942479, + "50": -1459.5306304510002, + "75": -750.1948036110768, + "95": 1428.796834935177, + "99": 3233.0438718527407, + "99.9": 4240.724502122051 + } + }, + "f2b": { + "units": "A", + "source": "ptdata:F2B", + "description": "Shaping F-coil F2B current (bank B).", + "min": -5788.286812358208, + "max": 5428.562849130928, + "mean": -1218.50048828125, + "std": 1316.67724609375, + "pct": { + "0.1": -4785.998935671587, + "1": -3520.521383204173, + "5": -2855.1671089762676, + "25": -1969.483606794242, + "50": -1447.1879016413761, + "75": -866.6265611311096, + "95": 2049.217650390811, + "99": 3312.4349928765846, + "99.9": 4011.5142868858347 + } + }, + "f3b": { + "units": "A", + "source": "ptdata:F3B", + "description": "Shaping F-coil F3B current (bank B).", + "min": -5503.943071765381, + "max": 4849.177948074737, + "mean": -1005.3848266601562, + "std": 1308.8258056640625, + "pct": { + "0.1": -4452.6277480541985, + "1": -3641.634707712471, + "5": -2937.4861003450947, + "25": -1881.7475544966392, + "50": -1170.6945714968547, + "75": -124.13671681902403, + "95": 1683.5400540223286, + "99": 3015.8060365193123, + "99.9": 3797.6599244161957 + } + }, + "f4b": { + "units": "A", + "source": "ptdata:F4B", + "description": "Shaping F-coil F4B current (bank B).", + "min": -5829.242194941551, + "max": 5787.149431930685, + "mean": 1124.2967529296875, + "std": 1519.5994873046875, + "pct": { + "0.1": -4083.976449898858, + "1": -3247.08251902718, + "5": -2270.942268479742, + "25": 376.8608226937906, + "50": 1392.450441038166, + "75": 2146.7001303629104, + "95": 3145.5476189867913, + "99": 3926.614817946318, + "99.9": 4582.551950710075 + } + }, + "f5b": { + "units": "A", + "source": "ptdata:F5B", + "description": "Shaping F-coil F5B current (bank B).", + "min": -5213.110339059254, + "max": 5388.213772287713, + "mean": 1443.536865234375, + "std": 1408.3306884765625, + "pct": { + "0.1": -4134.61747806435, + "1": -3056.873937432705, + "5": -1361.0988601293998, + "25": 675.1515533174199, + "50": 1572.802070225599, + "75": 2367.5452263604984, + "95": 3528.863240540377, + "99": 4411.454242162536, + "99.9": 4967.30642206674 + } + }, + "f6b": { + "units": "A", + "source": "ptdata:F6B", + "description": "Shaping F-coil F6B current (bank B).", + "min": -7604.653108484432, + "max": 7763.1261416792295, + "mean": -2463.248046875, + "std": 1836.4208984375, + "pct": { + "0.1": -6372.627428710043, + "1": -5251.4106280007745, + "5": -4318.157196234368, + "25": -3524.5849152058445, + "50": -2837.2759930056304, + "75": -2089.94465303326, + "95": 2871.6849973390945, + "99": 3948.010461650111, + "99.9": 4803.251616324593 + } + }, + "f7b": { + "units": "A", + "source": "ptdata:F7B", + "description": "Shaping F-coil F7B current (bank B).", + "min": -11380.254539563213, + "max": 9414.242772782009, + "mean": -2941.56005859375, + "std": 2510.1083984375, + "pct": { + "0.1": -9236.286164628174, + "1": -7962.01372128499, + "5": -6618.689743738845, + "25": -4397.68407591947, + "50": -3041.7944101983817, + "75": -2113.0768216001165, + "95": 2850.240503964187, + "99": 5238.131223534479, + "99.9": 6771.41582857779 + } + }, + "f8b": { + "units": "A", + "source": "ptdata:F8B", + "description": "Shaping F-coil F8B current (bank B).", + "min": -5834.457886045129, + "max": 5952.292180058913, + "mean": 1431.05615234375, + "std": 1718.2965087890625, + "pct": { + "0.1": -4377.886849186064, + "1": -3547.8568327724756, + "5": -2536.325388000092, + "25": 592.1441487378677, + "50": 1743.1741236182588, + "75": 2613.9050347435855, + "95": 3655.019608301406, + "99": 4295.252919476556, + "99.9": 5183.621783504976 + } + }, + "f9b": { + "units": "A", + "source": "ptdata:F9B", + "description": "Shaping F-coil F9B current (bank B).", + "min": -7298.33418485197, + "max": 8673.475372842513, + "mean": -214.02586364746094, + "std": 1388.83447265625, + "pct": { + "0.1": -4443.002941036773, + "1": -3335.961239603393, + "5": -2530.3434455144015, + "25": -1111.6205754278508, + "50": -212.41719832099042, + "75": 564.1401009862525, + "95": 2296.158459733251, + "99": 3401.023805016151, + "99.9": 4981.695296538042 + } + }, + "ecoila": { + "units": "A", + "source": "ptdata:ECOILA", + "description": "Ohmic E-coil bank A current.", + "min": -68526.67779690563, + "max": 65669.33446503483, + "mean": -6965.32666015625, + "std": 18940.9453125, + "pct": { + "0.1": -62521.0592220894, + "1": -53449.0677376177, + "5": -39610.65329064206, + "25": -19599.348704727538, + "50": -6887.604056684089, + "75": 6065.040591650557, + "95": 23926.96154448237, + "99": 33650.27142286909, + "99.9": 48164.54971213867 + } + }, + "ecoilb": { + "units": "A", + "source": "ptdata:ECOILB", + "description": "Ohmic E-coil bank B current.", + "min": -67880.78461590248, + "max": 67380.80764904841, + "mean": -6876.16455078125, + "std": 18723.662109375, + "pct": { + "0.1": -61839.528701402356, + "1": -52787.079189397904, + "5": -39153.2527665565, + "25": -19383.82435886666, + "50": -6768.996463787789, + "75": 6013.297288247475, + "95": 23686.641557508636, + "99": 33187.653018934754, + "99.9": 47362.43837391052 + } + }, + "gasa_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "description": "Calibrated gas injection flow, valve A.", + "min": -0.9805486760911233, + "max": 348.1779045740827, + "mean": 15.054444313049316, + "std": 26.369497299194336, + "pct": { + "0.1": -0.0181447514768128, + "1": 0.0006228885411054819, + "5": 0.0014589414841879034, + "25": 0.00852798057103854, + "50": 0.09974314587981326, + "75": 19.645558552678416, + "95": 71.02669389337856, + "99": 137.36341388263276, + "99.9": 211.79616738152396 + } + }, + "gasb_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "description": "Calibrated gas injection flow, valve B.", + "min": -0.5231055139632899, + "max": 317.69717326145866, + "mean": 1.386172890663147, + "std": 3.4090511798858643, + "pct": { + "0.1": 9.14047308575583e-06, + "1": 0.0007714573310613204, + "5": 0.002068321612864521, + "25": 0.009055124211873267, + "50": 0.07339015461169385, + "75": 1.9421402622606716, + "95": 1.9421402622606716, + "99": 23.663863921838843, + "99.9": 149.40068998150738 + } + }, + "gasc_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "description": "Calibrated gas injection flow, valve C.", + "min": -0.3965804467767108, + "max": 306.0269668007428, + "mean": 0.35034820437431335, + "std": 0.4470684826374054, + "pct": { + "0.1": 7.428448363699935e-05, + "1": 0.00026770734685732656, + "5": 0.0006667805693404416, + "25": 0.002788385500787083, + "50": 0.023577950502740697, + "75": 0.7508911827356307, + "95": 0.7508911827356307, + "99": 2.733332630282, + "99.9": 108.67323889612304 + } + }, + "gasd_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "description": "Calibrated gas injection flow, valve D.", + "min": -0.5287260135880842, + "max": 771.5043798529183, + "mean": 0.528103232383728, + "std": 0.654624342918396, + "pct": { + "0.1": 5.497087182604332e-05, + "1": 0.000175335120693898, + "5": 0.0005482846440516553, + "25": 0.003719433481388368, + "50": 0.08385269566973214, + "75": 1.0383906373403984, + "95": 1.0383906373403984, + "99": 4.359676988215197, + "99.9": 127.54440071212512 + } + }, + "gase_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "description": "Calibrated gas injection flow, valve E.", + "min": -0.2211384331710633, + "max": 672.8582070151267, + "mean": 0.27696067094802856, + "std": 0.17616958916187286, + "pct": { + "0.1": 0.00010156410138473793, + "1": 0.000223585566083373, + "5": 0.0005190716405260032, + "25": 0.011627604901727706, + "50": 0.3920832239686922, + "75": 0.3920832239686922, + "95": 0.3920832239686922, + "99": 0.3920832239686922, + "99.9": 29.75536079519976 + } + }, + "bt": { + "units": "T", + "source": "ptdata:bt", + "description": "Vacuum toroidal magnetic field (signed).", + "min": -2.2353815075115375, + "max": 2.25186423641397, + "mean": -0.971906840801239, + "std": 1.6484158039093018, + "pct": { + "0.1": -2.2151064134142304, + "1": -2.1819873443702726, + "5": -2.136304350652244, + "25": -2.0446028795017246, + "50": -1.8984274308309796, + "75": -1.0260122281948352, + "95": 2.053318112027725, + "99": 2.10945640328767, + "99.9": 2.1819705410137904 + } + } + } +} diff --git a/s1/fuse29_seq.onnx b/s1/fuse29_seq.onnx new file mode 100644 index 0000000000000000000000000000000000000000..bf1d603de4325bb45e2b05362d4169101267f890 --- /dev/null +++ b/s1/fuse29_seq.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3469221c38b1006a017506969d2ffd5f9b84a9a34d22b4429184a299c2438f4a +size 45464382 diff --git a/s1/fuse29_step.onnx b/s1/fuse29_step.onnx new file mode 100644 index 0000000000000000000000000000000000000000..df2b8d4abc77c2d23eb3eed5b786217bd440ded4 --- /dev/null +++ b/s1/fuse29_step.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8780126cca821664426bafdd896a1313846da69ad120b9c591d90dc0cc21249e +size 45081271 diff --git a/s1/model_config.json b/s1/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..87bf92e3d72d52cec47bff91ba8ef8a26e0fdfb2 --- /dev/null +++ b/s1/model_config.json @@ -0,0 +1,268 @@ +{ + "schema_version": 1, + "model": "fuse29", + "seed": 1, + "description": "29-input Mamba-2 pedestal predictor for DIII-D. Strictly causal, 20 Hz, nine heads at rho_tor = 0.85.", + "architecture": { + "family": "Mamba-2 (structured state-space duality)", + "d_model": 512, + "n_layers": 6, + "d_state": 128, + "d_conv": 4, + "expand": 2, + "headdim": 128, + "nheads": 8, + "ngroups": 2, + "chunk_size": 100, + "d_inner": 1024, + "conv_dim": 1536, + "n_params": 11254425 + }, + "cadence": { + "hz": 20, + "period_ms": 50.0, + "rho_tor": 0.85 + }, + "inputs": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "n": 29, + "units": { + "pinj": "MW", + "tinj": "N*m", + "ech_total": "MW", + "f1a": "A", + "f2a": "A", + "f3a": "A", + "f4a": "A", + "f5a": "A", + "f6a": "A", + "f7a": "A", + "f8a": "A", + "f9a": "A", + "f1b": "A", + "f2b": "A", + "f3b": "A", + "f4b": "A", + "f5b": "A", + "f6b": "A", + "f7b": "A", + "f8b": "A", + "f9b": "A", + "ecoila": "A", + "ecoilb": "A", + "gasa_cal": "Torr*L/s", + "gasb_cal": "Torr*L/s", + "gasc_cal": "Torr*L/s", + "gasd_cal": "Torr*L/s", + "gase_cal": "Torr*L/s", + "bt": "T" + }, + "sources": { + "pinj": "ptdata:bmspinj", + "tinj": "ptdata:bmstinj", + "ech_total": "ptdata:ECHPWR", + "f1a": "ptdata:F1A", + "f2a": "ptdata:F2A", + "f3a": "ptdata:F3A", + "f4a": "ptdata:F4A", + "f5a": "ptdata:F5A", + "f6a": "ptdata:F6A", + "f7a": "ptdata:F7A", + "f8a": "ptdata:F8A", + "f9a": "ptdata:F9A", + "f1b": "ptdata:F1B", + "f2b": "ptdata:F2B", + "f3b": "ptdata:F3B", + "f4b": "ptdata:F4B", + "f5b": "ptdata:F5B", + "f6b": "ptdata:F6B", + "f7b": "ptdata:F7B", + "f8b": "ptdata:F8B", + "f9b": "ptdata:F9B", + "ecoila": "ptdata:ECOILA", + "ecoilb": "ptdata:ECOILB", + "gasa_cal": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "gasb_cal": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "gasc_cal": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "gasd_cal": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "gase_cal": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "bt": "ptdata:bt" + }, + "descriptions": { + "pinj": "Neutral beam injected power, all sources.", + "tinj": "Neutral beam injected torque, all sources.", + "ech_total": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "f1a": "Shaping F-coil F1A current (bank A).", + "f2a": "Shaping F-coil F2A current (bank A).", + "f3a": "Shaping F-coil F3A current (bank A).", + "f4a": "Shaping F-coil F4A current (bank A).", + "f5a": "Shaping F-coil F5A current (bank A).", + "f6a": "Shaping F-coil F6A current (bank A).", + "f7a": "Shaping F-coil F7A current (bank A).", + "f8a": "Shaping F-coil F8A current (bank A).", + "f9a": "Shaping F-coil F9A current (bank A).", + "f1b": "Shaping F-coil F1B current (bank B).", + "f2b": "Shaping F-coil F2B current (bank B).", + "f3b": "Shaping F-coil F3B current (bank B).", + "f4b": "Shaping F-coil F4B current (bank B).", + "f5b": "Shaping F-coil F5B current (bank B).", + "f6b": "Shaping F-coil F6B current (bank B).", + "f7b": "Shaping F-coil F7B current (bank B).", + "f8b": "Shaping F-coil F8B current (bank B).", + "f9b": "Shaping F-coil F9B current (bank B).", + "ecoila": "Ohmic E-coil bank A current.", + "ecoilb": "Ohmic E-coil bank B current.", + "gasa_cal": "Calibrated gas injection flow, valve A.", + "gasb_cal": "Calibrated gas injection flow, valve B.", + "gasc_cal": "Calibrated gas injection flow, valve C.", + "gasd_cal": "Calibrated gas injection flow, valve D.", + "gase_cal": "Calibrated gas injection flow, valve E.", + "bt": "Vacuum toroidal magnetic field (signed)." + }, + "space": "raw physical units; the graph applies the z-score", + "note": "Check your units against actuator_ranges.json before trusting any output. A unit error produces confident nonsense rather than an exception." + }, + "outputs": { + "names": [ + "ne", + "te_ped", + "ti_ped", + "t_rot_ped", + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc", + "hmode" + ], + "n": 9, + "units": { + "ne": "1e19 m^-3", + "te_ped": "keV", + "ti_ped": "keV", + "t_rot_ped": "krad/s", + "neped_prmtan": "1e19 m^-3", + "teped_prmtan": "keV", + "rho_sym": "rho_tor (dimensionless)", + "ne_top_loc": "rho_tor (dimensionless)", + "hmode": "probability in [0, 1]" + }, + "note": "Physical units. hmode is a probability in [0, 1]; the graph applies the sigmoid.", + "hmode_gated": { + "heads": [ + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc" + ], + "indices": [ + 4, + 5, + 6, + 7 + ], + "threshold": 0.5, + "note": "These four heads were trained only on H-mode rows and are undefined otherwise. The graph does NOT gate them; the consumer must, using the model's own hmode output. See docs/GATING.md." + } + }, + "graphs": { + "fuse29_step.onnx": { + "purpose": "real-time, one 50 ms tick per call", + "inputs": { + "actuators": [ + "batch", + 29 + ], + "conv_state": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "outputs": { + "predictions": [ + "batch", + 9 + ], + "conv_state_out": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state_out": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "initial_state": "all zeros at the start of a shot", + "max_shot_length": "unbounded" + }, + "fuse29_seq.onnx": { + "purpose": "offline scoring of a whole shot", + "inputs": { + "actuators": [ + "batch", + 256, + 29 + ] + }, + "outputs": { + "predictions": [ + "batch", + 256, + 9 + ] + }, + "seq_len": 256, + "note": "Sequence length is FIXED. Right-pad shorter shots with zeros and read the first T outputs; the model is strictly causal so this is exact. For longer shots use the step graph or re-export with --seq-len." + } + }, + "dtype": "float32", + "onnx_opset": 17, + "training": { + "epoch": 22, + "val_loss": 1.1129196528345346, + "note": "See docs/TRAINING.md for the full recipe." + } +} diff --git a/s1/norms.json b/s1/norms.json new file mode 100644 index 0000000000000000000000000000000000000000..98c8c06209fd050ed78c21fa5b30afd95a71c171 --- /dev/null +++ b/s1/norms.json @@ -0,0 +1,292 @@ +{ + "schema_version": 2, + "note": "Statistics are baked into the shipped ONNX graphs. This file is for inspection and for reproducing the transform outside the graph; it is not required at inference time.", + "actuator_space": "physical", + "std_floor": 1e-06, + "clip_sigma": 20.0, + "provenance": { + "split": "train", + "n_shots": 32731, + "rho_index": 85, + "source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85, random stratified split (split_index.json)", + "note": "Recomputed on the NEW random train split. The source shards carried z-scores from the OLD chronological train split, whose shots overlap our test set. Actuator statistics are winsorised so a corrupted sample cannot set a channel's divisor.", + "inflated_channels": [ + "pinj", + "gasc_cal", + "gasd_cal", + "gase_cal" + ], + "actuator_estimator": "winsorised to p1..p99", + "actuator_space": "physical", + "composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "composition": "z = (x_phys - (m1 + s1*m2)) / (s1*s2), where (m1, s1) is the upstream FPE z-score and (m2, s2) is this model's re-scale onto its own training split" + }, + "actuators": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "mean": [ + 3.838883638381958, + 2.2043209075927734, + 2.6981112957000732, + -1382.3704833984375, + -1229.876708984375, + -592.7352294921875, + 1098.1622314453125, + 1173.57958984375, + -2493.411865234375, + -2367.570556640625, + 996.0214233398438, + -535.8018798828125, + -1373.1888427734375, + -1218.50048828125, + -1005.3848266601562, + 1124.2967529296875, + 1443.536865234375, + -2463.248046875, + -2941.56005859375, + 1431.05615234375, + -214.02586364746094, + -6965.32666015625, + -6876.16455078125, + 15.054444313049316, + 1.386172890663147, + 0.35034820437431335, + 0.528103232383728, + 0.27696067094802856, + -0.971906840801239 + ], + "std": [ + 3.0613932609558105, + 2.11222505569458, + 6.685519218444824, + 1349.629638671875, + 1248.3497314453125, + 1185.706298828125, + 1368.95458984375, + 1352.103759765625, + 1867.8076171875, + 1999.19970703125, + 1498.948974609375, + 1258.01171875, + 1367.82275390625, + 1316.67724609375, + 1308.8258056640625, + 1519.5994873046875, + 1408.3306884765625, + 1836.4208984375, + 2510.1083984375, + 1718.2965087890625, + 1388.83447265625, + 18940.9453125, + 18723.662109375, + 26.369497299194336, + 3.4090511798858643, + 0.4470684826374054, + 0.654624342918396, + 0.17616958916187286, + 1.6484158039093018 + ], + "transform": "z = clip((x - mean) / std, -clip_sigma, +clip_sigma), applied inside the graph" + }, + "targets": { + "ne": { + "mean": 2.7511744499206543, + "std": 1.654153823852539 + }, + "te_ped": { + "mean": 0.5915626287460327, + "std": 0.43467429280281067 + }, + "ti_ped": { + "mean": 1.016850233078003, + "std": 0.681096076965332 + }, + "t_rot_ped": { + "mean": 21.244613647460938, + "std": 16.59148406982422 + }, + "neped_prmtan": { + "mean": 2.7231285572052, + "std": 1.7005536556243896 + }, + "teped_prmtan": { + "mean": 0.46375223994255066, + "std": 0.36919456720352173 + }, + "rho_sym": { + "mean": 0.9757616519927979, + "std": 0.04329206794500351 + }, + "ne_top_loc": { + "mean": 0.9261865019798279, + "std": 0.049897171556949615 + } + }, + "hmode": { + "transform": "sigmoid", + "note": "hmode is a logit in the trunk; the graph applies the sigmoid." + }, + "stages": { + "note": "The composed actuator statistics above are the product of these two. Shown for traceability; use the composed values.", + "stage1_physical_to_fpe_zscore": { + "mean": [ + 2.8111997039100878, + 2.154143940948575, + 2.159654935239209, + -1444.0438445123289, + -1315.1185221229061, + -639.741760304047, + 1172.4978680515835, + 1222.4970107268077, + -2488.8410961768263, + -2491.3739557685253, + 1050.107386405324, + -578.9736547563273, + -1421.0817159358041, + -1285.3967398730092, + -1061.0290851406676, + 1186.4795970820587, + 1460.6822372728345, + -2452.093120847959, + -3071.3132492215186, + 1531.3304960724108, + -262.6728625067526, + -6887.604056684089, + -6768.996463787789, + 14.89178144369171, + 1.9421402622606716, + 0.7508911827356307, + 1.0383906373403984, + 0.3920832239686922, + -1.0310375752078498 + ], + "std": [ + 194.08418888726106, + 2.3684465859740262, + 5.948083564785035, + 1267.4907621702682, + 1217.4478106828162, + 1249.3915272640536, + 1345.3871181128568, + 1359.1934832307923, + 1887.1891497052302, + 1888.1014577442652, + 1559.9875106371376, + 1287.2118470203372, + 1271.813282654729, + 1259.8644805335082, + 1361.9306367877398, + 1521.172083160852, + 1393.2120473032558, + 1856.723912629122, + 2432.8530409799628, + 1705.6959050005082, + 1421.8036451037203, + 19092.148992270486, + 18858.28389193975, + 27.289184462156058, + 11.092415079529571, + 9.017289768908354, + 12.055982101097918, + 6.498888909025979, + 1.599000778986496 + ] + }, + "stage2_fpe_zscore_to_model": { + "mean": [ + 0.0052950419485569, + 0.02118559367954731, + 0.0905260294675827, + 0.04865782707929611, + 0.0700167864561081, + 0.03762352466583252, + -0.05525219440460205, + -0.03599006310105324, + -0.002421961398795247, + 0.06557027250528336, + -0.03467077016830444, + 0.03353898227214813, + 0.03765711933374405, + 0.05309795215725899, + 0.040856875479221344, + -0.04087827727198601, + -0.012306398712098598, + -0.006007813848555088, + 0.05333370715379715, + -0.05878793075680733, + 0.03421499580144882, + -0.004070908762514591, + -0.00568280229344964, + 0.005960696842521429, + -0.050121404230594635, + -0.04441944137215614, + -0.042326491326093674, + -0.017714189365506172, + 0.036979787051677704 + ], + "std": [ + 0.015773532912135124, + 0.8918187022209167, + 1.1239787340164185, + 1.0648043155670166, + 1.0253825187683105, + 0.9490270018577576, + 1.0175172090530396, + 0.994783878326416, + 0.9897299408912659, + 1.0588412284851074, + 0.9608724117279053, + 0.9773152470588684, + 1.0754902362823486, + 1.04509437084198, + 0.9610077142715454, + 0.9989661574363708, + 1.0108516216278076, + 0.9890651702880859, + 1.0317550897598267, + 1.007387399673462, + 0.9768117070198059, + 0.9920803308486938, + 0.9928614497184753, + 0.9662984609603882, + 0.30733174085617065, + 0.04957903176546097, + 0.05429871752858162, + 0.02710764855146408, + 1.030903697013855 + ] + } + } +} diff --git a/s1/provenance.json b/s1/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..01787efee991138d657e4ed9aee9187fc75bd312 --- /dev/null +++ b/s1/provenance.json @@ -0,0 +1,32 @@ +{ + "schema_version": 1, + "exported_utc": "2026-09-03T00:46:24.670692+00:00", + "seed": 1, + "source_checkpoint": "/flare/fusiondl_aesp/fuse_bd_model/fuse20/runs/fuse29r_s1/best_model.pt", + "source_checkpoint_sha256": "a77e8a7359c47e1f6d9a2406fe29fea9214e6110e3a4f5f26371afbaba236394", + "norms_source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json", + "norms_actuator_space": "physical", + "norms_composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "onnx_opset": 17, + "exporter": "torch.onnx.export (TorchScript, dynamo=False)", + "versions": { + "torch": "2.10.0a0+git449b176", + "python": "3.12.12", + "platform": "Linux-5.14.21-150400.24.235-default-x86_64-with-glibc2.31", + "onnx": "1.22.0", + "onnxruntime": "1.29.0" + }, + "artifacts": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "8780126cca821664426bafdd896a1313846da69ad120b9c591d90dc0cc21249e" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "3469221c38b1006a017506969d2ffd5f9b84a9a34d22b4429184a299c2438f4a" + } + } +} diff --git a/s2/README.md b/s2/README.md new file mode 100644 index 0000000000000000000000000000000000000000..af506c2804d41a5009ddf32683f4f608da4df376 --- /dev/null +++ b/s2/README.md @@ -0,0 +1,56 @@ +--- +license: mit +library_name: onnx +tags: + - onnx + - fusion + - plasma-physics + - tokamak + - diii-d + - mamba +--- + +# fuse29 — seed 2 + +This is seed 2, one of eight independently trained runs. Seed 0 is the champion and the default; this one exists so you can measure spread across training runs. Unless you are doing that, you want seed 0. + +29-input Mamba-2 pedestal predictor for DIII-D. Raw physical units in, +physical units out. See the [root model card](https://huggingface.co/SCS-Lab/FUSE29-Pedestal-model) +for the full description, I/O contract, accuracy and limitations. + +| | | +|---|---| +| Seed | 2 | +| Parameters | 11,254,425 | +| Best validation loss | 1.1197 | +| Sequence graph length | 256 ticks | +| ONNX opset | 17 | +| Exported | 2026-09-03T00:46:27.308435+00:00 | +| Source checkpoint SHA-256 | `d113f84516d9e749…` | + +## Load + +```python +from fuse29.runtime import Fuse29Predictor + +predictor = Fuse29Predictor.from_pretrained("SCS-Lab/FUSE29-Pedestal-model", seed=2) +``` + +## Files + +| File | | +|---|---| +| `fuse29_step.onnx` | one 50 ms tick, carries state, no length limit | +| `fuse29_seq.onnx` | whole shot at a fixed 256 ticks | +| `model_config.json` | I/O contract: names, order, units, sources, shapes | +| `norms.json` | the statistics baked into the graphs | +| `actuator_ranges.json` | training-split distribution, for checking your units | +| `provenance.json` | source checkpoint hash, library versions, artefact hashes | + +## Before you use it + +- Four heads (`neped_prmtan`, `teped_prmtan`, `rho_sym`, `ne_top_loc`) are + **only valid in H-mode** and the graph does not gate them. Gate on the + model's own `hmode` output. +- `pinj` is in **MW**, not W. Run `predictor.check_units(shot)` once. +- Output column order is not alphabetical. See `model_config.json`. diff --git a/s2/actuator_ranges.json b/s2/actuator_ranges.json new file mode 100644 index 0000000000000000000000000000000000000000..08d19f4e80f49e6bbd18c40674b06946a02cc61a --- /dev/null +++ b/s2/actuator_ranges.json @@ -0,0 +1,600 @@ +{ + "schema_version": 1, + "note": "Physical-units distribution of each actuator over the training split. Use it to check that your signals are in the units the graph expects; a unit error is the one preprocessing mistake that produces confident nonsense rather than an exception.", + "split": "train", + "n_shots": 32731, + "n_ticks": 3020926, + "percentiles": [ + 0.1, + 1, + 5, + 25, + 50, + 75, + 95, + 99, + 99.9 + ], + "channels": { + "pinj": { + "units": "MW", + "source": "ptdata:bmspinj", + "description": "Neutral beam injected power, all sources.", + "min": -46005.02701919088, + "max": 17.512712760455507, + "mean": 3.838883638381958, + "std": 3.0613932609558105, + "pct": { + "0.1": -0.004132416388869853, + "1": 4.112187479421436e-09, + "5": 4.112187479421436e-09, + "25": 1.311169336894574, + "50": 3.18466408866965, + "75": 5.748764762873332, + "95": 9.841882532311711, + "99": 12.212702351352696, + "99.9": 14.791924355083399 + } + }, + "tinj": { + "units": "N*m", + "source": "ptdata:bmstinj", + "description": "Neutral beam injected torque, all sources.", + "min": -56.644382966354534, + "max": 129.9833380295058, + "mean": 2.2043209075927734, + "std": 2.11222505569458, + "pct": { + "0.1": -2.0636791725994676, + "1": -0.5384317586520496, + "5": -1.6338495756329507e-07, + "25": 0.4319133403840452, + "50": 1.963846077087278, + "75": 3.1821234334199193, + "95": 6.641525317445799, + "99": 8.941231792062355, + "99.9": 11.156712776956862 + } + }, + "ech_total": { + "units": "MW", + "source": "ptdata:ECHPWR", + "description": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "min": -19.31181996542309, + "max": 40.286455582885246, + "mean": 2.6981112957000732, + "std": 6.685519218444824, + "pct": { + "0.1": -1.0663586061709935, + "1": -0.09982622583332723, + "5": -0.020836448436920674, + "25": -3.2566890961760464e-08, + "50": -3.2566890961760464e-08, + "75": 1.1717011943616973, + "95": 21.558252060431304, + "99": 30.476182922859127, + "99.9": 37.09168917133024 + } + }, + "f1a": { + "units": "A", + "source": "ptdata:F1A", + "description": "Shaping F-coil F1A current (bank A).", + "min": -5776.925892871883, + "max": 5794.3504737288395, + "mean": -1382.3704833984375, + "std": 1349.629638671875, + "pct": { + "0.1": -4852.691808601986, + "1": -4131.456225748339, + "5": -3401.8604035239678, + "25": -2236.4754469921672, + "50": -1501.5458201268116, + "75": -660.4245966463927, + "95": 1294.4315819071094, + "99": 3103.250955923345, + "99.9": 4467.289606367005 + } + }, + "f2a": { + "units": "A", + "source": "ptdata:F2A", + "description": "Shaping F-coil F2A current (bank A).", + "min": -5716.347659616551, + "max": 5702.840977614059, + "mean": -1229.876708984375, + "std": 1248.3497314453125, + "pct": { + "0.1": -4093.397230708888, + "1": -3297.8668360449756, + "5": -2712.522533155646, + "25": -2004.455454331444, + "50": -1443.842241803098, + "75": -854.5004209979342, + "95": 1825.579117167513, + "99": 3097.0902901803724, + "99.9": 3899.548655232026 + } + }, + "f3a": { + "units": "A", + "source": "ptdata:F3A", + "description": "Shaping F-coil F3A current (bank A).", + "min": -5498.272347966228, + "max": 5321.719922394657, + "mean": -592.7352294921875, + "std": 1185.706298828125, + "pct": { + "0.1": -4140.690909683277, + "1": -3539.2136012211317, + "5": -2813.2888996278725, + "25": -1377.7435033975407, + "50": -152.16189816331342, + "75": 2.4453898354848604, + "95": 1203.107532773337, + "99": 2898.3184344684487, + "99.9": 3780.0556837479485 + } + }, + "f4a": { + "units": "A", + "source": "ptdata:F4A", + "description": "Shaping F-coil F4A current (bank A).", + "min": -5876.373800845117, + "max": 5855.700219305917, + "mean": 1098.1622314453125, + "std": 1368.95458984375, + "pct": { + "0.1": -4331.218505807293, + "1": -3344.4526378786877, + "5": -1858.4157962413597, + "25": 395.84891116184133, + "50": 1143.436262581068, + "75": 1990.2677717095535, + "95": 3141.5448401142426, + "99": 3756.430079500399, + "99.9": 4525.754910416766 + } + }, + "f5a": { + "units": "A", + "source": "ptdata:F5A", + "description": "Shaping F-coil F5A current (bank A).", + "min": -5178.8539079385355, + "max": 5353.141466672798, + "mean": 1173.57958984375, + "std": 1352.103759765625, + "pct": { + "0.1": -4592.7059148331355, + "1": -3597.7201189044818, + "5": -1551.4942446467403, + "25": 543.836095032849, + "50": 1273.969119983141, + "75": 2051.0443148459794, + "95": 3019.669622905384, + "99": 3875.454685744494, + "99.9": 4738.506855960392 + } + }, + "f6a": { + "units": "A", + "source": "ptdata:F6A", + "description": "Shaping F-coil F6A current (bank A).", + "min": -7929.903731492232, + "max": 5741.056818467809, + "mean": -2493.411865234375, + "std": 1867.8076171875, + "pct": { + "0.1": -6125.90268588119, + "1": -4963.398523516425, + "5": -4319.477588996284, + "25": -3574.8234234024885, + "50": -2898.635802832382, + "75": -2143.0930801744807, + "95": 2999.75903843203, + "99": 4137.6543157735705, + "99.9": 4783.375582166487 + } + }, + "f7a": { + "units": "A", + "source": "ptdata:F7A", + "description": "Shaping F-coil F7A current (bank A).", + "min": -9825.736080045011, + "max": 8678.484606762057, + "mean": -2367.570556640625, + "std": 1999.19970703125, + "pct": { + "0.1": -7676.219824168618, + "1": -6127.379912259545, + "5": -4909.893927511103, + "25": -3430.1309476786882, + "50": -2697.460342263373, + "75": -1913.0579478721388, + "95": 2723.164038733837, + "99": 3948.221013655396, + "99.9": 5316.086800760559 + } + }, + "f8a": { + "units": "A", + "source": "ptdata:F8A", + "description": "Shaping F-coil F8A current (bank A).", + "min": -5378.835169240788, + "max": 5880.767402237174, + "mean": 996.0214233398438, + "std": 1498.948974609375, + "pct": { + "0.1": -4229.744640827867, + "1": -3363.368412210415, + "5": -1922.2114690963926, + "25": 60.761390529545906, + "50": 1153.9241798399726, + "75": 1951.1572686642544, + "95": 3318.078493605748, + "99": 3973.7764489149104, + "99.9": 4670.296725684707 + } + }, + "f9a": { + "units": "A", + "source": "ptdata:F9A", + "description": "Shaping F-coil F9A current (bank A).", + "min": -7206.032812499594, + "max": 8700.684616308497, + "mean": -535.8018798828125, + "std": 1258.01171875, + "pct": { + "0.1": -4739.927394914494, + "1": -3344.557163847978, + "5": -2567.420669960383, + "25": -1538.6304412830955, + "50": -578.9736547563273, + "75": 353.08467764596537, + "95": 1558.2607279613098, + "99": 2657.691791383836, + "99.9": 4334.930796170508 + } + }, + "f1b": { + "units": "A", + "source": "ptdata:F1B", + "description": "Shaping F-coil F1B current (bank B).", + "min": -5921.943154546981, + "max": 5407.326196618229, + "mean": -1373.1888427734375, + "std": 1367.82275390625, + "pct": { + "0.1": -5179.567735964654, + "1": -4339.478258925401, + "5": -3463.431883510691, + "25": -2205.922070942479, + "50": -1459.5306304510002, + "75": -750.1948036110768, + "95": 1428.796834935177, + "99": 3233.0438718527407, + "99.9": 4240.724502122051 + } + }, + "f2b": { + "units": "A", + "source": "ptdata:F2B", + "description": "Shaping F-coil F2B current (bank B).", + "min": -5788.286812358208, + "max": 5428.562849130928, + "mean": -1218.50048828125, + "std": 1316.67724609375, + "pct": { + "0.1": -4785.998935671587, + "1": -3520.521383204173, + "5": -2855.1671089762676, + "25": -1969.483606794242, + "50": -1447.1879016413761, + "75": -866.6265611311096, + "95": 2049.217650390811, + "99": 3312.4349928765846, + "99.9": 4011.5142868858347 + } + }, + "f3b": { + "units": "A", + "source": "ptdata:F3B", + "description": "Shaping F-coil F3B current (bank B).", + "min": -5503.943071765381, + "max": 4849.177948074737, + "mean": -1005.3848266601562, + "std": 1308.8258056640625, + "pct": { + "0.1": -4452.6277480541985, + "1": -3641.634707712471, + "5": -2937.4861003450947, + "25": -1881.7475544966392, + "50": -1170.6945714968547, + "75": -124.13671681902403, + "95": 1683.5400540223286, + "99": 3015.8060365193123, + "99.9": 3797.6599244161957 + } + }, + "f4b": { + "units": "A", + "source": "ptdata:F4B", + "description": "Shaping F-coil F4B current (bank B).", + "min": -5829.242194941551, + "max": 5787.149431930685, + "mean": 1124.2967529296875, + "std": 1519.5994873046875, + "pct": { + "0.1": -4083.976449898858, + "1": -3247.08251902718, + "5": -2270.942268479742, + "25": 376.8608226937906, + "50": 1392.450441038166, + "75": 2146.7001303629104, + "95": 3145.5476189867913, + "99": 3926.614817946318, + "99.9": 4582.551950710075 + } + }, + "f5b": { + "units": "A", + "source": "ptdata:F5B", + "description": "Shaping F-coil F5B current (bank B).", + "min": -5213.110339059254, + "max": 5388.213772287713, + "mean": 1443.536865234375, + "std": 1408.3306884765625, + "pct": { + "0.1": -4134.61747806435, + "1": -3056.873937432705, + "5": -1361.0988601293998, + "25": 675.1515533174199, + "50": 1572.802070225599, + "75": 2367.5452263604984, + "95": 3528.863240540377, + "99": 4411.454242162536, + "99.9": 4967.30642206674 + } + }, + "f6b": { + "units": "A", + "source": "ptdata:F6B", + "description": "Shaping F-coil F6B current (bank B).", + "min": -7604.653108484432, + "max": 7763.1261416792295, + "mean": -2463.248046875, + "std": 1836.4208984375, + "pct": { + "0.1": -6372.627428710043, + "1": -5251.4106280007745, + "5": -4318.157196234368, + "25": -3524.5849152058445, + "50": -2837.2759930056304, + "75": -2089.94465303326, + "95": 2871.6849973390945, + "99": 3948.010461650111, + "99.9": 4803.251616324593 + } + }, + "f7b": { + "units": "A", + "source": "ptdata:F7B", + "description": "Shaping F-coil F7B current (bank B).", + "min": -11380.254539563213, + "max": 9414.242772782009, + "mean": -2941.56005859375, + "std": 2510.1083984375, + "pct": { + "0.1": -9236.286164628174, + "1": -7962.01372128499, + "5": -6618.689743738845, + "25": -4397.68407591947, + "50": -3041.7944101983817, + "75": -2113.0768216001165, + "95": 2850.240503964187, + "99": 5238.131223534479, + "99.9": 6771.41582857779 + } + }, + "f8b": { + "units": "A", + "source": "ptdata:F8B", + "description": "Shaping F-coil F8B current (bank B).", + "min": -5834.457886045129, + "max": 5952.292180058913, + "mean": 1431.05615234375, + "std": 1718.2965087890625, + "pct": { + "0.1": -4377.886849186064, + "1": -3547.8568327724756, + "5": -2536.325388000092, + "25": 592.1441487378677, + "50": 1743.1741236182588, + "75": 2613.9050347435855, + "95": 3655.019608301406, + "99": 4295.252919476556, + "99.9": 5183.621783504976 + } + }, + "f9b": { + "units": "A", + "source": "ptdata:F9B", + "description": "Shaping F-coil F9B current (bank B).", + "min": -7298.33418485197, + "max": 8673.475372842513, + "mean": -214.02586364746094, + "std": 1388.83447265625, + "pct": { + "0.1": -4443.002941036773, + "1": -3335.961239603393, + "5": -2530.3434455144015, + "25": -1111.6205754278508, + "50": -212.41719832099042, + "75": 564.1401009862525, + "95": 2296.158459733251, + "99": 3401.023805016151, + "99.9": 4981.695296538042 + } + }, + "ecoila": { + "units": "A", + "source": "ptdata:ECOILA", + "description": "Ohmic E-coil bank A current.", + "min": -68526.67779690563, + "max": 65669.33446503483, + "mean": -6965.32666015625, + "std": 18940.9453125, + "pct": { + "0.1": -62521.0592220894, + "1": -53449.0677376177, + "5": -39610.65329064206, + "25": -19599.348704727538, + "50": -6887.604056684089, + "75": 6065.040591650557, + "95": 23926.96154448237, + "99": 33650.27142286909, + "99.9": 48164.54971213867 + } + }, + "ecoilb": { + "units": "A", + "source": "ptdata:ECOILB", + "description": "Ohmic E-coil bank B current.", + "min": -67880.78461590248, + "max": 67380.80764904841, + "mean": -6876.16455078125, + "std": 18723.662109375, + "pct": { + "0.1": -61839.528701402356, + "1": -52787.079189397904, + "5": -39153.2527665565, + "25": -19383.82435886666, + "50": -6768.996463787789, + "75": 6013.297288247475, + "95": 23686.641557508636, + "99": 33187.653018934754, + "99.9": 47362.43837391052 + } + }, + "gasa_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "description": "Calibrated gas injection flow, valve A.", + "min": -0.9805486760911233, + "max": 348.1779045740827, + "mean": 15.054444313049316, + "std": 26.369497299194336, + "pct": { + "0.1": -0.0181447514768128, + "1": 0.0006228885411054819, + "5": 0.0014589414841879034, + "25": 0.00852798057103854, + "50": 0.09974314587981326, + "75": 19.645558552678416, + "95": 71.02669389337856, + "99": 137.36341388263276, + "99.9": 211.79616738152396 + } + }, + "gasb_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "description": "Calibrated gas injection flow, valve B.", + "min": -0.5231055139632899, + "max": 317.69717326145866, + "mean": 1.386172890663147, + "std": 3.4090511798858643, + "pct": { + "0.1": 9.14047308575583e-06, + "1": 0.0007714573310613204, + "5": 0.002068321612864521, + "25": 0.009055124211873267, + "50": 0.07339015461169385, + "75": 1.9421402622606716, + "95": 1.9421402622606716, + "99": 23.663863921838843, + "99.9": 149.40068998150738 + } + }, + "gasc_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "description": "Calibrated gas injection flow, valve C.", + "min": -0.3965804467767108, + "max": 306.0269668007428, + "mean": 0.35034820437431335, + "std": 0.4470684826374054, + "pct": { + "0.1": 7.428448363699935e-05, + "1": 0.00026770734685732656, + "5": 0.0006667805693404416, + "25": 0.002788385500787083, + "50": 0.023577950502740697, + "75": 0.7508911827356307, + "95": 0.7508911827356307, + "99": 2.733332630282, + "99.9": 108.67323889612304 + } + }, + "gasd_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "description": "Calibrated gas injection flow, valve D.", + "min": -0.5287260135880842, + "max": 771.5043798529183, + "mean": 0.528103232383728, + "std": 0.654624342918396, + "pct": { + "0.1": 5.497087182604332e-05, + "1": 0.000175335120693898, + "5": 0.0005482846440516553, + "25": 0.003719433481388368, + "50": 0.08385269566973214, + "75": 1.0383906373403984, + "95": 1.0383906373403984, + "99": 4.359676988215197, + "99.9": 127.54440071212512 + } + }, + "gase_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "description": "Calibrated gas injection flow, valve E.", + "min": -0.2211384331710633, + "max": 672.8582070151267, + "mean": 0.27696067094802856, + "std": 0.17616958916187286, + "pct": { + "0.1": 0.00010156410138473793, + "1": 0.000223585566083373, + "5": 0.0005190716405260032, + "25": 0.011627604901727706, + "50": 0.3920832239686922, + "75": 0.3920832239686922, + "95": 0.3920832239686922, + "99": 0.3920832239686922, + "99.9": 29.75536079519976 + } + }, + "bt": { + "units": "T", + "source": "ptdata:bt", + "description": "Vacuum toroidal magnetic field (signed).", + "min": -2.2353815075115375, + "max": 2.25186423641397, + "mean": -0.971906840801239, + "std": 1.6484158039093018, + "pct": { + "0.1": -2.2151064134142304, + "1": -2.1819873443702726, + "5": -2.136304350652244, + "25": -2.0446028795017246, + "50": -1.8984274308309796, + "75": -1.0260122281948352, + "95": 2.053318112027725, + "99": 2.10945640328767, + "99.9": 2.1819705410137904 + } + } + } +} diff --git a/s2/fuse29_seq.onnx b/s2/fuse29_seq.onnx new file mode 100644 index 0000000000000000000000000000000000000000..59a55d715bafb537b8d2ec73438db031a6e8060c --- /dev/null +++ b/s2/fuse29_seq.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fc339449427dfe47ee425eb7ff500887e6a10ae1ef32d90207f2d1e3a828cf3 +size 45464382 diff --git a/s2/fuse29_step.onnx b/s2/fuse29_step.onnx new file mode 100644 index 0000000000000000000000000000000000000000..3c41dfc6f41045727c42409b189bf7cb1189d54e --- /dev/null +++ b/s2/fuse29_step.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b696b9c645441cde3881ff796aaec6e1927335daba4539095f6b6dee8a5768f4 +size 45081271 diff --git a/s2/model_config.json b/s2/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..5919980ca3ef220791b9a8062073eca3c7978c30 --- /dev/null +++ b/s2/model_config.json @@ -0,0 +1,268 @@ +{ + "schema_version": 1, + "model": "fuse29", + "seed": 2, + "description": "29-input Mamba-2 pedestal predictor for DIII-D. Strictly causal, 20 Hz, nine heads at rho_tor = 0.85.", + "architecture": { + "family": "Mamba-2 (structured state-space duality)", + "d_model": 512, + "n_layers": 6, + "d_state": 128, + "d_conv": 4, + "expand": 2, + "headdim": 128, + "nheads": 8, + "ngroups": 2, + "chunk_size": 100, + "d_inner": 1024, + "conv_dim": 1536, + "n_params": 11254425 + }, + "cadence": { + "hz": 20, + "period_ms": 50.0, + "rho_tor": 0.85 + }, + "inputs": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "n": 29, + "units": { + "pinj": "MW", + "tinj": "N*m", + "ech_total": "MW", + "f1a": "A", + "f2a": "A", + "f3a": "A", + "f4a": "A", + "f5a": "A", + "f6a": "A", + "f7a": "A", + "f8a": "A", + "f9a": "A", + "f1b": "A", + "f2b": "A", + "f3b": "A", + "f4b": "A", + "f5b": "A", + "f6b": "A", + "f7b": "A", + "f8b": "A", + "f9b": "A", + "ecoila": "A", + "ecoilb": "A", + "gasa_cal": "Torr*L/s", + "gasb_cal": "Torr*L/s", + "gasc_cal": "Torr*L/s", + "gasd_cal": "Torr*L/s", + "gase_cal": "Torr*L/s", + "bt": "T" + }, + "sources": { + "pinj": "ptdata:bmspinj", + "tinj": "ptdata:bmstinj", + "ech_total": "ptdata:ECHPWR", + "f1a": "ptdata:F1A", + "f2a": "ptdata:F2A", + "f3a": "ptdata:F3A", + "f4a": "ptdata:F4A", + "f5a": "ptdata:F5A", + "f6a": "ptdata:F6A", + "f7a": "ptdata:F7A", + "f8a": "ptdata:F8A", + "f9a": "ptdata:F9A", + "f1b": "ptdata:F1B", + "f2b": "ptdata:F2B", + "f3b": "ptdata:F3B", + "f4b": "ptdata:F4B", + "f5b": "ptdata:F5B", + "f6b": "ptdata:F6B", + "f7b": "ptdata:F7B", + "f8b": "ptdata:F8B", + "f9b": "ptdata:F9B", + "ecoila": "ptdata:ECOILA", + "ecoilb": "ptdata:ECOILB", + "gasa_cal": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "gasb_cal": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "gasc_cal": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "gasd_cal": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "gase_cal": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "bt": "ptdata:bt" + }, + "descriptions": { + "pinj": "Neutral beam injected power, all sources.", + "tinj": "Neutral beam injected torque, all sources.", + "ech_total": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "f1a": "Shaping F-coil F1A current (bank A).", + "f2a": "Shaping F-coil F2A current (bank A).", + "f3a": "Shaping F-coil F3A current (bank A).", + "f4a": "Shaping F-coil F4A current (bank A).", + "f5a": "Shaping F-coil F5A current (bank A).", + "f6a": "Shaping F-coil F6A current (bank A).", + "f7a": "Shaping F-coil F7A current (bank A).", + "f8a": "Shaping F-coil F8A current (bank A).", + "f9a": "Shaping F-coil F9A current (bank A).", + "f1b": "Shaping F-coil F1B current (bank B).", + "f2b": "Shaping F-coil F2B current (bank B).", + "f3b": "Shaping F-coil F3B current (bank B).", + "f4b": "Shaping F-coil F4B current (bank B).", + "f5b": "Shaping F-coil F5B current (bank B).", + "f6b": "Shaping F-coil F6B current (bank B).", + "f7b": "Shaping F-coil F7B current (bank B).", + "f8b": "Shaping F-coil F8B current (bank B).", + "f9b": "Shaping F-coil F9B current (bank B).", + "ecoila": "Ohmic E-coil bank A current.", + "ecoilb": "Ohmic E-coil bank B current.", + "gasa_cal": "Calibrated gas injection flow, valve A.", + "gasb_cal": "Calibrated gas injection flow, valve B.", + "gasc_cal": "Calibrated gas injection flow, valve C.", + "gasd_cal": "Calibrated gas injection flow, valve D.", + "gase_cal": "Calibrated gas injection flow, valve E.", + "bt": "Vacuum toroidal magnetic field (signed)." + }, + "space": "raw physical units; the graph applies the z-score", + "note": "Check your units against actuator_ranges.json before trusting any output. A unit error produces confident nonsense rather than an exception." + }, + "outputs": { + "names": [ + "ne", + "te_ped", + "ti_ped", + "t_rot_ped", + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc", + "hmode" + ], + "n": 9, + "units": { + "ne": "1e19 m^-3", + "te_ped": "keV", + "ti_ped": "keV", + "t_rot_ped": "krad/s", + "neped_prmtan": "1e19 m^-3", + "teped_prmtan": "keV", + "rho_sym": "rho_tor (dimensionless)", + "ne_top_loc": "rho_tor (dimensionless)", + "hmode": "probability in [0, 1]" + }, + "note": "Physical units. hmode is a probability in [0, 1]; the graph applies the sigmoid.", + "hmode_gated": { + "heads": [ + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc" + ], + "indices": [ + 4, + 5, + 6, + 7 + ], + "threshold": 0.5, + "note": "These four heads were trained only on H-mode rows and are undefined otherwise. The graph does NOT gate them; the consumer must, using the model's own hmode output. See docs/GATING.md." + } + }, + "graphs": { + "fuse29_step.onnx": { + "purpose": "real-time, one 50 ms tick per call", + "inputs": { + "actuators": [ + "batch", + 29 + ], + "conv_state": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "outputs": { + "predictions": [ + "batch", + 9 + ], + "conv_state_out": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state_out": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "initial_state": "all zeros at the start of a shot", + "max_shot_length": "unbounded" + }, + "fuse29_seq.onnx": { + "purpose": "offline scoring of a whole shot", + "inputs": { + "actuators": [ + "batch", + 256, + 29 + ] + }, + "outputs": { + "predictions": [ + "batch", + 256, + 9 + ] + }, + "seq_len": 256, + "note": "Sequence length is FIXED. Right-pad shorter shots with zeros and read the first T outputs; the model is strictly causal so this is exact. For longer shots use the step graph or re-export with --seq-len." + } + }, + "dtype": "float32", + "onnx_opset": 17, + "training": { + "epoch": 20, + "val_loss": 1.119664316996932, + "note": "See docs/TRAINING.md for the full recipe." + } +} diff --git a/s2/norms.json b/s2/norms.json new file mode 100644 index 0000000000000000000000000000000000000000..98c8c06209fd050ed78c21fa5b30afd95a71c171 --- /dev/null +++ b/s2/norms.json @@ -0,0 +1,292 @@ +{ + "schema_version": 2, + "note": "Statistics are baked into the shipped ONNX graphs. This file is for inspection and for reproducing the transform outside the graph; it is not required at inference time.", + "actuator_space": "physical", + "std_floor": 1e-06, + "clip_sigma": 20.0, + "provenance": { + "split": "train", + "n_shots": 32731, + "rho_index": 85, + "source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85, random stratified split (split_index.json)", + "note": "Recomputed on the NEW random train split. The source shards carried z-scores from the OLD chronological train split, whose shots overlap our test set. Actuator statistics are winsorised so a corrupted sample cannot set a channel's divisor.", + "inflated_channels": [ + "pinj", + "gasc_cal", + "gasd_cal", + "gase_cal" + ], + "actuator_estimator": "winsorised to p1..p99", + "actuator_space": "physical", + "composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "composition": "z = (x_phys - (m1 + s1*m2)) / (s1*s2), where (m1, s1) is the upstream FPE z-score and (m2, s2) is this model's re-scale onto its own training split" + }, + "actuators": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "mean": [ + 3.838883638381958, + 2.2043209075927734, + 2.6981112957000732, + -1382.3704833984375, + -1229.876708984375, + -592.7352294921875, + 1098.1622314453125, + 1173.57958984375, + -2493.411865234375, + -2367.570556640625, + 996.0214233398438, + -535.8018798828125, + -1373.1888427734375, + -1218.50048828125, + -1005.3848266601562, + 1124.2967529296875, + 1443.536865234375, + -2463.248046875, + -2941.56005859375, + 1431.05615234375, + -214.02586364746094, + -6965.32666015625, + -6876.16455078125, + 15.054444313049316, + 1.386172890663147, + 0.35034820437431335, + 0.528103232383728, + 0.27696067094802856, + -0.971906840801239 + ], + "std": [ + 3.0613932609558105, + 2.11222505569458, + 6.685519218444824, + 1349.629638671875, + 1248.3497314453125, + 1185.706298828125, + 1368.95458984375, + 1352.103759765625, + 1867.8076171875, + 1999.19970703125, + 1498.948974609375, + 1258.01171875, + 1367.82275390625, + 1316.67724609375, + 1308.8258056640625, + 1519.5994873046875, + 1408.3306884765625, + 1836.4208984375, + 2510.1083984375, + 1718.2965087890625, + 1388.83447265625, + 18940.9453125, + 18723.662109375, + 26.369497299194336, + 3.4090511798858643, + 0.4470684826374054, + 0.654624342918396, + 0.17616958916187286, + 1.6484158039093018 + ], + "transform": "z = clip((x - mean) / std, -clip_sigma, +clip_sigma), applied inside the graph" + }, + "targets": { + "ne": { + "mean": 2.7511744499206543, + "std": 1.654153823852539 + }, + "te_ped": { + "mean": 0.5915626287460327, + "std": 0.43467429280281067 + }, + "ti_ped": { + "mean": 1.016850233078003, + "std": 0.681096076965332 + }, + "t_rot_ped": { + "mean": 21.244613647460938, + "std": 16.59148406982422 + }, + "neped_prmtan": { + "mean": 2.7231285572052, + "std": 1.7005536556243896 + }, + "teped_prmtan": { + "mean": 0.46375223994255066, + "std": 0.36919456720352173 + }, + "rho_sym": { + "mean": 0.9757616519927979, + "std": 0.04329206794500351 + }, + "ne_top_loc": { + "mean": 0.9261865019798279, + "std": 0.049897171556949615 + } + }, + "hmode": { + "transform": "sigmoid", + "note": "hmode is a logit in the trunk; the graph applies the sigmoid." + }, + "stages": { + "note": "The composed actuator statistics above are the product of these two. Shown for traceability; use the composed values.", + "stage1_physical_to_fpe_zscore": { + "mean": [ + 2.8111997039100878, + 2.154143940948575, + 2.159654935239209, + -1444.0438445123289, + -1315.1185221229061, + -639.741760304047, + 1172.4978680515835, + 1222.4970107268077, + -2488.8410961768263, + -2491.3739557685253, + 1050.107386405324, + -578.9736547563273, + -1421.0817159358041, + -1285.3967398730092, + -1061.0290851406676, + 1186.4795970820587, + 1460.6822372728345, + -2452.093120847959, + -3071.3132492215186, + 1531.3304960724108, + -262.6728625067526, + -6887.604056684089, + -6768.996463787789, + 14.89178144369171, + 1.9421402622606716, + 0.7508911827356307, + 1.0383906373403984, + 0.3920832239686922, + -1.0310375752078498 + ], + "std": [ + 194.08418888726106, + 2.3684465859740262, + 5.948083564785035, + 1267.4907621702682, + 1217.4478106828162, + 1249.3915272640536, + 1345.3871181128568, + 1359.1934832307923, + 1887.1891497052302, + 1888.1014577442652, + 1559.9875106371376, + 1287.2118470203372, + 1271.813282654729, + 1259.8644805335082, + 1361.9306367877398, + 1521.172083160852, + 1393.2120473032558, + 1856.723912629122, + 2432.8530409799628, + 1705.6959050005082, + 1421.8036451037203, + 19092.148992270486, + 18858.28389193975, + 27.289184462156058, + 11.092415079529571, + 9.017289768908354, + 12.055982101097918, + 6.498888909025979, + 1.599000778986496 + ] + }, + "stage2_fpe_zscore_to_model": { + "mean": [ + 0.0052950419485569, + 0.02118559367954731, + 0.0905260294675827, + 0.04865782707929611, + 0.0700167864561081, + 0.03762352466583252, + -0.05525219440460205, + -0.03599006310105324, + -0.002421961398795247, + 0.06557027250528336, + -0.03467077016830444, + 0.03353898227214813, + 0.03765711933374405, + 0.05309795215725899, + 0.040856875479221344, + -0.04087827727198601, + -0.012306398712098598, + -0.006007813848555088, + 0.05333370715379715, + -0.05878793075680733, + 0.03421499580144882, + -0.004070908762514591, + -0.00568280229344964, + 0.005960696842521429, + -0.050121404230594635, + -0.04441944137215614, + -0.042326491326093674, + -0.017714189365506172, + 0.036979787051677704 + ], + "std": [ + 0.015773532912135124, + 0.8918187022209167, + 1.1239787340164185, + 1.0648043155670166, + 1.0253825187683105, + 0.9490270018577576, + 1.0175172090530396, + 0.994783878326416, + 0.9897299408912659, + 1.0588412284851074, + 0.9608724117279053, + 0.9773152470588684, + 1.0754902362823486, + 1.04509437084198, + 0.9610077142715454, + 0.9989661574363708, + 1.0108516216278076, + 0.9890651702880859, + 1.0317550897598267, + 1.007387399673462, + 0.9768117070198059, + 0.9920803308486938, + 0.9928614497184753, + 0.9662984609603882, + 0.30733174085617065, + 0.04957903176546097, + 0.05429871752858162, + 0.02710764855146408, + 1.030903697013855 + ] + } + } +} diff --git a/s2/provenance.json b/s2/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..8ae0ff5b41dd1183a6b1ba6a402e861a9bad15ac --- /dev/null +++ b/s2/provenance.json @@ -0,0 +1,32 @@ +{ + "schema_version": 1, + "exported_utc": "2026-09-03T00:46:27.308435+00:00", + "seed": 2, + "source_checkpoint": "/flare/fusiondl_aesp/fuse_bd_model/fuse20/runs/fuse29r_s2/best_model.pt", + "source_checkpoint_sha256": "d113f84516d9e749eea611ebc53086e170a251ba50ec4f60ec69bfc5d82d92bf", + "norms_source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json", + "norms_actuator_space": "physical", + "norms_composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "onnx_opset": 17, + "exporter": "torch.onnx.export (TorchScript, dynamo=False)", + "versions": { + "torch": "2.10.0a0+git449b176", + "python": "3.12.12", + "platform": "Linux-5.14.21-150400.24.235-default-x86_64-with-glibc2.31", + "onnx": "1.22.0", + "onnxruntime": "1.29.0" + }, + "artifacts": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "b696b9c645441cde3881ff796aaec6e1927335daba4539095f6b6dee8a5768f4" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "1fc339449427dfe47ee425eb7ff500887e6a10ae1ef32d90207f2d1e3a828cf3" + } + } +} diff --git a/s3/README.md b/s3/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1f0a631ddbc82a5a3e7bd243593bf5f44164ef3b --- /dev/null +++ b/s3/README.md @@ -0,0 +1,56 @@ +--- +license: mit +library_name: onnx +tags: + - onnx + - fusion + - plasma-physics + - tokamak + - diii-d + - mamba +--- + +# fuse29 — seed 3 + +This is seed 3, one of eight independently trained runs. Seed 0 is the champion and the default; this one exists so you can measure spread across training runs. Unless you are doing that, you want seed 0. + +29-input Mamba-2 pedestal predictor for DIII-D. Raw physical units in, +physical units out. See the [root model card](https://huggingface.co/SCS-Lab/FUSE29-Pedestal-model) +for the full description, I/O contract, accuracy and limitations. + +| | | +|---|---| +| Seed | 3 | +| Parameters | 11,254,425 | +| Best validation loss | 1.1190 | +| Sequence graph length | 256 ticks | +| ONNX opset | 17 | +| Exported | 2026-09-03T00:46:29.898835+00:00 | +| Source checkpoint SHA-256 | `ec8986c56b48bf90…` | + +## Load + +```python +from fuse29.runtime import Fuse29Predictor + +predictor = Fuse29Predictor.from_pretrained("SCS-Lab/FUSE29-Pedestal-model", seed=3) +``` + +## Files + +| File | | +|---|---| +| `fuse29_step.onnx` | one 50 ms tick, carries state, no length limit | +| `fuse29_seq.onnx` | whole shot at a fixed 256 ticks | +| `model_config.json` | I/O contract: names, order, units, sources, shapes | +| `norms.json` | the statistics baked into the graphs | +| `actuator_ranges.json` | training-split distribution, for checking your units | +| `provenance.json` | source checkpoint hash, library versions, artefact hashes | + +## Before you use it + +- Four heads (`neped_prmtan`, `teped_prmtan`, `rho_sym`, `ne_top_loc`) are + **only valid in H-mode** and the graph does not gate them. Gate on the + model's own `hmode` output. +- `pinj` is in **MW**, not W. Run `predictor.check_units(shot)` once. +- Output column order is not alphabetical. See `model_config.json`. diff --git a/s3/actuator_ranges.json b/s3/actuator_ranges.json new file mode 100644 index 0000000000000000000000000000000000000000..08d19f4e80f49e6bbd18c40674b06946a02cc61a --- /dev/null +++ b/s3/actuator_ranges.json @@ -0,0 +1,600 @@ +{ + "schema_version": 1, + "note": "Physical-units distribution of each actuator over the training split. Use it to check that your signals are in the units the graph expects; a unit error is the one preprocessing mistake that produces confident nonsense rather than an exception.", + "split": "train", + "n_shots": 32731, + "n_ticks": 3020926, + "percentiles": [ + 0.1, + 1, + 5, + 25, + 50, + 75, + 95, + 99, + 99.9 + ], + "channels": { + "pinj": { + "units": "MW", + "source": "ptdata:bmspinj", + "description": "Neutral beam injected power, all sources.", + "min": -46005.02701919088, + "max": 17.512712760455507, + "mean": 3.838883638381958, + "std": 3.0613932609558105, + "pct": { + "0.1": -0.004132416388869853, + "1": 4.112187479421436e-09, + "5": 4.112187479421436e-09, + "25": 1.311169336894574, + "50": 3.18466408866965, + "75": 5.748764762873332, + "95": 9.841882532311711, + "99": 12.212702351352696, + "99.9": 14.791924355083399 + } + }, + "tinj": { + "units": "N*m", + "source": "ptdata:bmstinj", + "description": "Neutral beam injected torque, all sources.", + "min": -56.644382966354534, + "max": 129.9833380295058, + "mean": 2.2043209075927734, + "std": 2.11222505569458, + "pct": { + "0.1": -2.0636791725994676, + "1": -0.5384317586520496, + "5": -1.6338495756329507e-07, + "25": 0.4319133403840452, + "50": 1.963846077087278, + "75": 3.1821234334199193, + "95": 6.641525317445799, + "99": 8.941231792062355, + "99.9": 11.156712776956862 + } + }, + "ech_total": { + "units": "MW", + "source": "ptdata:ECHPWR", + "description": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "min": -19.31181996542309, + "max": 40.286455582885246, + "mean": 2.6981112957000732, + "std": 6.685519218444824, + "pct": { + "0.1": -1.0663586061709935, + "1": -0.09982622583332723, + "5": -0.020836448436920674, + "25": -3.2566890961760464e-08, + "50": -3.2566890961760464e-08, + "75": 1.1717011943616973, + "95": 21.558252060431304, + "99": 30.476182922859127, + "99.9": 37.09168917133024 + } + }, + "f1a": { + "units": "A", + "source": "ptdata:F1A", + "description": "Shaping F-coil F1A current (bank A).", + "min": -5776.925892871883, + "max": 5794.3504737288395, + "mean": -1382.3704833984375, + "std": 1349.629638671875, + "pct": { + "0.1": -4852.691808601986, + "1": -4131.456225748339, + "5": -3401.8604035239678, + "25": -2236.4754469921672, + "50": -1501.5458201268116, + "75": -660.4245966463927, + "95": 1294.4315819071094, + "99": 3103.250955923345, + "99.9": 4467.289606367005 + } + }, + "f2a": { + "units": "A", + "source": "ptdata:F2A", + "description": "Shaping F-coil F2A current (bank A).", + "min": -5716.347659616551, + "max": 5702.840977614059, + "mean": -1229.876708984375, + "std": 1248.3497314453125, + "pct": { + "0.1": -4093.397230708888, + "1": -3297.8668360449756, + "5": -2712.522533155646, + "25": -2004.455454331444, + "50": -1443.842241803098, + "75": -854.5004209979342, + "95": 1825.579117167513, + "99": 3097.0902901803724, + "99.9": 3899.548655232026 + } + }, + "f3a": { + "units": "A", + "source": "ptdata:F3A", + "description": "Shaping F-coil F3A current (bank A).", + "min": -5498.272347966228, + "max": 5321.719922394657, + "mean": -592.7352294921875, + "std": 1185.706298828125, + "pct": { + "0.1": -4140.690909683277, + "1": -3539.2136012211317, + "5": -2813.2888996278725, + "25": -1377.7435033975407, + "50": -152.16189816331342, + "75": 2.4453898354848604, + "95": 1203.107532773337, + "99": 2898.3184344684487, + "99.9": 3780.0556837479485 + } + }, + "f4a": { + "units": "A", + "source": "ptdata:F4A", + "description": "Shaping F-coil F4A current (bank A).", + "min": -5876.373800845117, + "max": 5855.700219305917, + "mean": 1098.1622314453125, + "std": 1368.95458984375, + "pct": { + "0.1": -4331.218505807293, + "1": -3344.4526378786877, + "5": -1858.4157962413597, + "25": 395.84891116184133, + "50": 1143.436262581068, + "75": 1990.2677717095535, + "95": 3141.5448401142426, + "99": 3756.430079500399, + "99.9": 4525.754910416766 + } + }, + "f5a": { + "units": "A", + "source": "ptdata:F5A", + "description": "Shaping F-coil F5A current (bank A).", + "min": -5178.8539079385355, + "max": 5353.141466672798, + "mean": 1173.57958984375, + "std": 1352.103759765625, + "pct": { + "0.1": -4592.7059148331355, + "1": -3597.7201189044818, + "5": -1551.4942446467403, + "25": 543.836095032849, + "50": 1273.969119983141, + "75": 2051.0443148459794, + "95": 3019.669622905384, + "99": 3875.454685744494, + "99.9": 4738.506855960392 + } + }, + "f6a": { + "units": "A", + "source": "ptdata:F6A", + "description": "Shaping F-coil F6A current (bank A).", + "min": -7929.903731492232, + "max": 5741.056818467809, + "mean": -2493.411865234375, + "std": 1867.8076171875, + "pct": { + "0.1": -6125.90268588119, + "1": -4963.398523516425, + "5": -4319.477588996284, + "25": -3574.8234234024885, + "50": -2898.635802832382, + "75": -2143.0930801744807, + "95": 2999.75903843203, + "99": 4137.6543157735705, + "99.9": 4783.375582166487 + } + }, + "f7a": { + "units": "A", + "source": "ptdata:F7A", + "description": "Shaping F-coil F7A current (bank A).", + "min": -9825.736080045011, + "max": 8678.484606762057, + "mean": -2367.570556640625, + "std": 1999.19970703125, + "pct": { + "0.1": -7676.219824168618, + "1": -6127.379912259545, + "5": -4909.893927511103, + "25": -3430.1309476786882, + "50": -2697.460342263373, + "75": -1913.0579478721388, + "95": 2723.164038733837, + "99": 3948.221013655396, + "99.9": 5316.086800760559 + } + }, + "f8a": { + "units": "A", + "source": "ptdata:F8A", + "description": "Shaping F-coil F8A current (bank A).", + "min": -5378.835169240788, + "max": 5880.767402237174, + "mean": 996.0214233398438, + "std": 1498.948974609375, + "pct": { + "0.1": -4229.744640827867, + "1": -3363.368412210415, + "5": -1922.2114690963926, + "25": 60.761390529545906, + "50": 1153.9241798399726, + "75": 1951.1572686642544, + "95": 3318.078493605748, + "99": 3973.7764489149104, + "99.9": 4670.296725684707 + } + }, + "f9a": { + "units": "A", + "source": "ptdata:F9A", + "description": "Shaping F-coil F9A current (bank A).", + "min": -7206.032812499594, + "max": 8700.684616308497, + "mean": -535.8018798828125, + "std": 1258.01171875, + "pct": { + "0.1": -4739.927394914494, + "1": -3344.557163847978, + "5": -2567.420669960383, + "25": -1538.6304412830955, + "50": -578.9736547563273, + "75": 353.08467764596537, + "95": 1558.2607279613098, + "99": 2657.691791383836, + "99.9": 4334.930796170508 + } + }, + "f1b": { + "units": "A", + "source": "ptdata:F1B", + "description": "Shaping F-coil F1B current (bank B).", + "min": -5921.943154546981, + "max": 5407.326196618229, + "mean": -1373.1888427734375, + "std": 1367.82275390625, + "pct": { + "0.1": -5179.567735964654, + "1": -4339.478258925401, + "5": -3463.431883510691, + "25": -2205.922070942479, + "50": -1459.5306304510002, + "75": -750.1948036110768, + "95": 1428.796834935177, + "99": 3233.0438718527407, + "99.9": 4240.724502122051 + } + }, + "f2b": { + "units": "A", + "source": "ptdata:F2B", + "description": "Shaping F-coil F2B current (bank B).", + "min": -5788.286812358208, + "max": 5428.562849130928, + "mean": -1218.50048828125, + "std": 1316.67724609375, + "pct": { + "0.1": -4785.998935671587, + "1": -3520.521383204173, + "5": -2855.1671089762676, + "25": -1969.483606794242, + "50": -1447.1879016413761, + "75": -866.6265611311096, + "95": 2049.217650390811, + "99": 3312.4349928765846, + "99.9": 4011.5142868858347 + } + }, + "f3b": { + "units": "A", + "source": "ptdata:F3B", + "description": "Shaping F-coil F3B current (bank B).", + "min": -5503.943071765381, + "max": 4849.177948074737, + "mean": -1005.3848266601562, + "std": 1308.8258056640625, + "pct": { + "0.1": -4452.6277480541985, + "1": -3641.634707712471, + "5": -2937.4861003450947, + "25": -1881.7475544966392, + "50": -1170.6945714968547, + "75": -124.13671681902403, + "95": 1683.5400540223286, + "99": 3015.8060365193123, + "99.9": 3797.6599244161957 + } + }, + "f4b": { + "units": "A", + "source": "ptdata:F4B", + "description": "Shaping F-coil F4B current (bank B).", + "min": -5829.242194941551, + "max": 5787.149431930685, + "mean": 1124.2967529296875, + "std": 1519.5994873046875, + "pct": { + "0.1": -4083.976449898858, + "1": -3247.08251902718, + "5": -2270.942268479742, + "25": 376.8608226937906, + "50": 1392.450441038166, + "75": 2146.7001303629104, + "95": 3145.5476189867913, + "99": 3926.614817946318, + "99.9": 4582.551950710075 + } + }, + "f5b": { + "units": "A", + "source": "ptdata:F5B", + "description": "Shaping F-coil F5B current (bank B).", + "min": -5213.110339059254, + "max": 5388.213772287713, + "mean": 1443.536865234375, + "std": 1408.3306884765625, + "pct": { + "0.1": -4134.61747806435, + "1": -3056.873937432705, + "5": -1361.0988601293998, + "25": 675.1515533174199, + "50": 1572.802070225599, + "75": 2367.5452263604984, + "95": 3528.863240540377, + "99": 4411.454242162536, + "99.9": 4967.30642206674 + } + }, + "f6b": { + "units": "A", + "source": "ptdata:F6B", + "description": "Shaping F-coil F6B current (bank B).", + "min": -7604.653108484432, + "max": 7763.1261416792295, + "mean": -2463.248046875, + "std": 1836.4208984375, + "pct": { + "0.1": -6372.627428710043, + "1": -5251.4106280007745, + "5": -4318.157196234368, + "25": -3524.5849152058445, + "50": -2837.2759930056304, + "75": -2089.94465303326, + "95": 2871.6849973390945, + "99": 3948.010461650111, + "99.9": 4803.251616324593 + } + }, + "f7b": { + "units": "A", + "source": "ptdata:F7B", + "description": "Shaping F-coil F7B current (bank B).", + "min": -11380.254539563213, + "max": 9414.242772782009, + "mean": -2941.56005859375, + "std": 2510.1083984375, + "pct": { + "0.1": -9236.286164628174, + "1": -7962.01372128499, + "5": -6618.689743738845, + "25": -4397.68407591947, + "50": -3041.7944101983817, + "75": -2113.0768216001165, + "95": 2850.240503964187, + "99": 5238.131223534479, + "99.9": 6771.41582857779 + } + }, + "f8b": { + "units": "A", + "source": "ptdata:F8B", + "description": "Shaping F-coil F8B current (bank B).", + "min": -5834.457886045129, + "max": 5952.292180058913, + "mean": 1431.05615234375, + "std": 1718.2965087890625, + "pct": { + "0.1": -4377.886849186064, + "1": -3547.8568327724756, + "5": -2536.325388000092, + "25": 592.1441487378677, + "50": 1743.1741236182588, + "75": 2613.9050347435855, + "95": 3655.019608301406, + "99": 4295.252919476556, + "99.9": 5183.621783504976 + } + }, + "f9b": { + "units": "A", + "source": "ptdata:F9B", + "description": "Shaping F-coil F9B current (bank B).", + "min": -7298.33418485197, + "max": 8673.475372842513, + "mean": -214.02586364746094, + "std": 1388.83447265625, + "pct": { + "0.1": -4443.002941036773, + "1": -3335.961239603393, + "5": -2530.3434455144015, + "25": -1111.6205754278508, + "50": -212.41719832099042, + "75": 564.1401009862525, + "95": 2296.158459733251, + "99": 3401.023805016151, + "99.9": 4981.695296538042 + } + }, + "ecoila": { + "units": "A", + "source": "ptdata:ECOILA", + "description": "Ohmic E-coil bank A current.", + "min": -68526.67779690563, + "max": 65669.33446503483, + "mean": -6965.32666015625, + "std": 18940.9453125, + "pct": { + "0.1": -62521.0592220894, + "1": -53449.0677376177, + "5": -39610.65329064206, + "25": -19599.348704727538, + "50": -6887.604056684089, + "75": 6065.040591650557, + "95": 23926.96154448237, + "99": 33650.27142286909, + "99.9": 48164.54971213867 + } + }, + "ecoilb": { + "units": "A", + "source": "ptdata:ECOILB", + "description": "Ohmic E-coil bank B current.", + "min": -67880.78461590248, + "max": 67380.80764904841, + "mean": -6876.16455078125, + "std": 18723.662109375, + "pct": { + "0.1": -61839.528701402356, + "1": -52787.079189397904, + "5": -39153.2527665565, + "25": -19383.82435886666, + "50": -6768.996463787789, + "75": 6013.297288247475, + "95": 23686.641557508636, + "99": 33187.653018934754, + "99.9": 47362.43837391052 + } + }, + "gasa_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "description": "Calibrated gas injection flow, valve A.", + "min": -0.9805486760911233, + "max": 348.1779045740827, + "mean": 15.054444313049316, + "std": 26.369497299194336, + "pct": { + "0.1": -0.0181447514768128, + "1": 0.0006228885411054819, + "5": 0.0014589414841879034, + "25": 0.00852798057103854, + "50": 0.09974314587981326, + "75": 19.645558552678416, + "95": 71.02669389337856, + "99": 137.36341388263276, + "99.9": 211.79616738152396 + } + }, + "gasb_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "description": "Calibrated gas injection flow, valve B.", + "min": -0.5231055139632899, + "max": 317.69717326145866, + "mean": 1.386172890663147, + "std": 3.4090511798858643, + "pct": { + "0.1": 9.14047308575583e-06, + "1": 0.0007714573310613204, + "5": 0.002068321612864521, + "25": 0.009055124211873267, + "50": 0.07339015461169385, + "75": 1.9421402622606716, + "95": 1.9421402622606716, + "99": 23.663863921838843, + "99.9": 149.40068998150738 + } + }, + "gasc_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "description": "Calibrated gas injection flow, valve C.", + "min": -0.3965804467767108, + "max": 306.0269668007428, + "mean": 0.35034820437431335, + "std": 0.4470684826374054, + "pct": { + "0.1": 7.428448363699935e-05, + "1": 0.00026770734685732656, + "5": 0.0006667805693404416, + "25": 0.002788385500787083, + "50": 0.023577950502740697, + "75": 0.7508911827356307, + "95": 0.7508911827356307, + "99": 2.733332630282, + "99.9": 108.67323889612304 + } + }, + "gasd_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "description": "Calibrated gas injection flow, valve D.", + "min": -0.5287260135880842, + "max": 771.5043798529183, + "mean": 0.528103232383728, + "std": 0.654624342918396, + "pct": { + "0.1": 5.497087182604332e-05, + "1": 0.000175335120693898, + "5": 0.0005482846440516553, + "25": 0.003719433481388368, + "50": 0.08385269566973214, + "75": 1.0383906373403984, + "95": 1.0383906373403984, + "99": 4.359676988215197, + "99.9": 127.54440071212512 + } + }, + "gase_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "description": "Calibrated gas injection flow, valve E.", + "min": -0.2211384331710633, + "max": 672.8582070151267, + "mean": 0.27696067094802856, + "std": 0.17616958916187286, + "pct": { + "0.1": 0.00010156410138473793, + "1": 0.000223585566083373, + "5": 0.0005190716405260032, + "25": 0.011627604901727706, + "50": 0.3920832239686922, + "75": 0.3920832239686922, + "95": 0.3920832239686922, + "99": 0.3920832239686922, + "99.9": 29.75536079519976 + } + }, + "bt": { + "units": "T", + "source": "ptdata:bt", + "description": "Vacuum toroidal magnetic field (signed).", + "min": -2.2353815075115375, + "max": 2.25186423641397, + "mean": -0.971906840801239, + "std": 1.6484158039093018, + "pct": { + "0.1": -2.2151064134142304, + "1": -2.1819873443702726, + "5": -2.136304350652244, + "25": -2.0446028795017246, + "50": -1.8984274308309796, + "75": -1.0260122281948352, + "95": 2.053318112027725, + "99": 2.10945640328767, + "99.9": 2.1819705410137904 + } + } + } +} diff --git a/s3/fuse29_seq.onnx b/s3/fuse29_seq.onnx new file mode 100644 index 0000000000000000000000000000000000000000..405c83cab0c1d658c5810bd8694e8a0749fddf99 --- /dev/null +++ b/s3/fuse29_seq.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab580c091de0471edc8454085dcda9c88650e4995be5c2ec6bd7f8b1c87d7786 +size 45464382 diff --git a/s3/fuse29_step.onnx b/s3/fuse29_step.onnx new file mode 100644 index 0000000000000000000000000000000000000000..513604f9f04cb3d9af464a8112467c87ea61c636 --- /dev/null +++ b/s3/fuse29_step.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2b80d7f732cef7a21eb21e606cf4a3e63aa4a91a9ff6dde789d88e07fcd5418 +size 45081271 diff --git a/s3/model_config.json b/s3/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..499f772083fc3c0ed62b2a217c705c89429891ac --- /dev/null +++ b/s3/model_config.json @@ -0,0 +1,268 @@ +{ + "schema_version": 1, + "model": "fuse29", + "seed": 3, + "description": "29-input Mamba-2 pedestal predictor for DIII-D. Strictly causal, 20 Hz, nine heads at rho_tor = 0.85.", + "architecture": { + "family": "Mamba-2 (structured state-space duality)", + "d_model": 512, + "n_layers": 6, + "d_state": 128, + "d_conv": 4, + "expand": 2, + "headdim": 128, + "nheads": 8, + "ngroups": 2, + "chunk_size": 100, + "d_inner": 1024, + "conv_dim": 1536, + "n_params": 11254425 + }, + "cadence": { + "hz": 20, + "period_ms": 50.0, + "rho_tor": 0.85 + }, + "inputs": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "n": 29, + "units": { + "pinj": "MW", + "tinj": "N*m", + "ech_total": "MW", + "f1a": "A", + "f2a": "A", + "f3a": "A", + "f4a": "A", + "f5a": "A", + "f6a": "A", + "f7a": "A", + "f8a": "A", + "f9a": "A", + "f1b": "A", + "f2b": "A", + "f3b": "A", + "f4b": "A", + "f5b": "A", + "f6b": "A", + "f7b": "A", + "f8b": "A", + "f9b": "A", + "ecoila": "A", + "ecoilb": "A", + "gasa_cal": "Torr*L/s", + "gasb_cal": "Torr*L/s", + "gasc_cal": "Torr*L/s", + "gasd_cal": "Torr*L/s", + "gase_cal": "Torr*L/s", + "bt": "T" + }, + "sources": { + "pinj": "ptdata:bmspinj", + "tinj": "ptdata:bmstinj", + "ech_total": "ptdata:ECHPWR", + "f1a": "ptdata:F1A", + "f2a": "ptdata:F2A", + "f3a": "ptdata:F3A", + "f4a": "ptdata:F4A", + "f5a": "ptdata:F5A", + "f6a": "ptdata:F6A", + "f7a": "ptdata:F7A", + "f8a": "ptdata:F8A", + "f9a": "ptdata:F9A", + "f1b": "ptdata:F1B", + "f2b": "ptdata:F2B", + "f3b": "ptdata:F3B", + "f4b": "ptdata:F4B", + "f5b": "ptdata:F5B", + "f6b": "ptdata:F6B", + "f7b": "ptdata:F7B", + "f8b": "ptdata:F8B", + "f9b": "ptdata:F9B", + "ecoila": "ptdata:ECOILA", + "ecoilb": "ptdata:ECOILB", + "gasa_cal": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "gasb_cal": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "gasc_cal": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "gasd_cal": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "gase_cal": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "bt": "ptdata:bt" + }, + "descriptions": { + "pinj": "Neutral beam injected power, all sources.", + "tinj": "Neutral beam injected torque, all sources.", + "ech_total": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "f1a": "Shaping F-coil F1A current (bank A).", + "f2a": "Shaping F-coil F2A current (bank A).", + "f3a": "Shaping F-coil F3A current (bank A).", + "f4a": "Shaping F-coil F4A current (bank A).", + "f5a": "Shaping F-coil F5A current (bank A).", + "f6a": "Shaping F-coil F6A current (bank A).", + "f7a": "Shaping F-coil F7A current (bank A).", + "f8a": "Shaping F-coil F8A current (bank A).", + "f9a": "Shaping F-coil F9A current (bank A).", + "f1b": "Shaping F-coil F1B current (bank B).", + "f2b": "Shaping F-coil F2B current (bank B).", + "f3b": "Shaping F-coil F3B current (bank B).", + "f4b": "Shaping F-coil F4B current (bank B).", + "f5b": "Shaping F-coil F5B current (bank B).", + "f6b": "Shaping F-coil F6B current (bank B).", + "f7b": "Shaping F-coil F7B current (bank B).", + "f8b": "Shaping F-coil F8B current (bank B).", + "f9b": "Shaping F-coil F9B current (bank B).", + "ecoila": "Ohmic E-coil bank A current.", + "ecoilb": "Ohmic E-coil bank B current.", + "gasa_cal": "Calibrated gas injection flow, valve A.", + "gasb_cal": "Calibrated gas injection flow, valve B.", + "gasc_cal": "Calibrated gas injection flow, valve C.", + "gasd_cal": "Calibrated gas injection flow, valve D.", + "gase_cal": "Calibrated gas injection flow, valve E.", + "bt": "Vacuum toroidal magnetic field (signed)." + }, + "space": "raw physical units; the graph applies the z-score", + "note": "Check your units against actuator_ranges.json before trusting any output. A unit error produces confident nonsense rather than an exception." + }, + "outputs": { + "names": [ + "ne", + "te_ped", + "ti_ped", + "t_rot_ped", + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc", + "hmode" + ], + "n": 9, + "units": { + "ne": "1e19 m^-3", + "te_ped": "keV", + "ti_ped": "keV", + "t_rot_ped": "krad/s", + "neped_prmtan": "1e19 m^-3", + "teped_prmtan": "keV", + "rho_sym": "rho_tor (dimensionless)", + "ne_top_loc": "rho_tor (dimensionless)", + "hmode": "probability in [0, 1]" + }, + "note": "Physical units. hmode is a probability in [0, 1]; the graph applies the sigmoid.", + "hmode_gated": { + "heads": [ + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc" + ], + "indices": [ + 4, + 5, + 6, + 7 + ], + "threshold": 0.5, + "note": "These four heads were trained only on H-mode rows and are undefined otherwise. The graph does NOT gate them; the consumer must, using the model's own hmode output. See docs/GATING.md." + } + }, + "graphs": { + "fuse29_step.onnx": { + "purpose": "real-time, one 50 ms tick per call", + "inputs": { + "actuators": [ + "batch", + 29 + ], + "conv_state": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "outputs": { + "predictions": [ + "batch", + 9 + ], + "conv_state_out": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state_out": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "initial_state": "all zeros at the start of a shot", + "max_shot_length": "unbounded" + }, + "fuse29_seq.onnx": { + "purpose": "offline scoring of a whole shot", + "inputs": { + "actuators": [ + "batch", + 256, + 29 + ] + }, + "outputs": { + "predictions": [ + "batch", + 256, + 9 + ] + }, + "seq_len": 256, + "note": "Sequence length is FIXED. Right-pad shorter shots with zeros and read the first T outputs; the model is strictly causal so this is exact. For longer shots use the step graph or re-export with --seq-len." + } + }, + "dtype": "float32", + "onnx_opset": 17, + "training": { + "epoch": 20, + "val_loss": 1.1190400626510382, + "note": "See docs/TRAINING.md for the full recipe." + } +} diff --git a/s3/norms.json b/s3/norms.json new file mode 100644 index 0000000000000000000000000000000000000000..98c8c06209fd050ed78c21fa5b30afd95a71c171 --- /dev/null +++ b/s3/norms.json @@ -0,0 +1,292 @@ +{ + "schema_version": 2, + "note": "Statistics are baked into the shipped ONNX graphs. This file is for inspection and for reproducing the transform outside the graph; it is not required at inference time.", + "actuator_space": "physical", + "std_floor": 1e-06, + "clip_sigma": 20.0, + "provenance": { + "split": "train", + "n_shots": 32731, + "rho_index": 85, + "source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85, random stratified split (split_index.json)", + "note": "Recomputed on the NEW random train split. The source shards carried z-scores from the OLD chronological train split, whose shots overlap our test set. Actuator statistics are winsorised so a corrupted sample cannot set a channel's divisor.", + "inflated_channels": [ + "pinj", + "gasc_cal", + "gasd_cal", + "gase_cal" + ], + "actuator_estimator": "winsorised to p1..p99", + "actuator_space": "physical", + "composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "composition": "z = (x_phys - (m1 + s1*m2)) / (s1*s2), where (m1, s1) is the upstream FPE z-score and (m2, s2) is this model's re-scale onto its own training split" + }, + "actuators": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "mean": [ + 3.838883638381958, + 2.2043209075927734, + 2.6981112957000732, + -1382.3704833984375, + -1229.876708984375, + -592.7352294921875, + 1098.1622314453125, + 1173.57958984375, + -2493.411865234375, + -2367.570556640625, + 996.0214233398438, + -535.8018798828125, + -1373.1888427734375, + -1218.50048828125, + -1005.3848266601562, + 1124.2967529296875, + 1443.536865234375, + -2463.248046875, + -2941.56005859375, + 1431.05615234375, + -214.02586364746094, + -6965.32666015625, + -6876.16455078125, + 15.054444313049316, + 1.386172890663147, + 0.35034820437431335, + 0.528103232383728, + 0.27696067094802856, + -0.971906840801239 + ], + "std": [ + 3.0613932609558105, + 2.11222505569458, + 6.685519218444824, + 1349.629638671875, + 1248.3497314453125, + 1185.706298828125, + 1368.95458984375, + 1352.103759765625, + 1867.8076171875, + 1999.19970703125, + 1498.948974609375, + 1258.01171875, + 1367.82275390625, + 1316.67724609375, + 1308.8258056640625, + 1519.5994873046875, + 1408.3306884765625, + 1836.4208984375, + 2510.1083984375, + 1718.2965087890625, + 1388.83447265625, + 18940.9453125, + 18723.662109375, + 26.369497299194336, + 3.4090511798858643, + 0.4470684826374054, + 0.654624342918396, + 0.17616958916187286, + 1.6484158039093018 + ], + "transform": "z = clip((x - mean) / std, -clip_sigma, +clip_sigma), applied inside the graph" + }, + "targets": { + "ne": { + "mean": 2.7511744499206543, + "std": 1.654153823852539 + }, + "te_ped": { + "mean": 0.5915626287460327, + "std": 0.43467429280281067 + }, + "ti_ped": { + "mean": 1.016850233078003, + "std": 0.681096076965332 + }, + "t_rot_ped": { + "mean": 21.244613647460938, + "std": 16.59148406982422 + }, + "neped_prmtan": { + "mean": 2.7231285572052, + "std": 1.7005536556243896 + }, + "teped_prmtan": { + "mean": 0.46375223994255066, + "std": 0.36919456720352173 + }, + "rho_sym": { + "mean": 0.9757616519927979, + "std": 0.04329206794500351 + }, + "ne_top_loc": { + "mean": 0.9261865019798279, + "std": 0.049897171556949615 + } + }, + "hmode": { + "transform": "sigmoid", + "note": "hmode is a logit in the trunk; the graph applies the sigmoid." + }, + "stages": { + "note": "The composed actuator statistics above are the product of these two. Shown for traceability; use the composed values.", + "stage1_physical_to_fpe_zscore": { + "mean": [ + 2.8111997039100878, + 2.154143940948575, + 2.159654935239209, + -1444.0438445123289, + -1315.1185221229061, + -639.741760304047, + 1172.4978680515835, + 1222.4970107268077, + -2488.8410961768263, + -2491.3739557685253, + 1050.107386405324, + -578.9736547563273, + -1421.0817159358041, + -1285.3967398730092, + -1061.0290851406676, + 1186.4795970820587, + 1460.6822372728345, + -2452.093120847959, + -3071.3132492215186, + 1531.3304960724108, + -262.6728625067526, + -6887.604056684089, + -6768.996463787789, + 14.89178144369171, + 1.9421402622606716, + 0.7508911827356307, + 1.0383906373403984, + 0.3920832239686922, + -1.0310375752078498 + ], + "std": [ + 194.08418888726106, + 2.3684465859740262, + 5.948083564785035, + 1267.4907621702682, + 1217.4478106828162, + 1249.3915272640536, + 1345.3871181128568, + 1359.1934832307923, + 1887.1891497052302, + 1888.1014577442652, + 1559.9875106371376, + 1287.2118470203372, + 1271.813282654729, + 1259.8644805335082, + 1361.9306367877398, + 1521.172083160852, + 1393.2120473032558, + 1856.723912629122, + 2432.8530409799628, + 1705.6959050005082, + 1421.8036451037203, + 19092.148992270486, + 18858.28389193975, + 27.289184462156058, + 11.092415079529571, + 9.017289768908354, + 12.055982101097918, + 6.498888909025979, + 1.599000778986496 + ] + }, + "stage2_fpe_zscore_to_model": { + "mean": [ + 0.0052950419485569, + 0.02118559367954731, + 0.0905260294675827, + 0.04865782707929611, + 0.0700167864561081, + 0.03762352466583252, + -0.05525219440460205, + -0.03599006310105324, + -0.002421961398795247, + 0.06557027250528336, + -0.03467077016830444, + 0.03353898227214813, + 0.03765711933374405, + 0.05309795215725899, + 0.040856875479221344, + -0.04087827727198601, + -0.012306398712098598, + -0.006007813848555088, + 0.05333370715379715, + -0.05878793075680733, + 0.03421499580144882, + -0.004070908762514591, + -0.00568280229344964, + 0.005960696842521429, + -0.050121404230594635, + -0.04441944137215614, + -0.042326491326093674, + -0.017714189365506172, + 0.036979787051677704 + ], + "std": [ + 0.015773532912135124, + 0.8918187022209167, + 1.1239787340164185, + 1.0648043155670166, + 1.0253825187683105, + 0.9490270018577576, + 1.0175172090530396, + 0.994783878326416, + 0.9897299408912659, + 1.0588412284851074, + 0.9608724117279053, + 0.9773152470588684, + 1.0754902362823486, + 1.04509437084198, + 0.9610077142715454, + 0.9989661574363708, + 1.0108516216278076, + 0.9890651702880859, + 1.0317550897598267, + 1.007387399673462, + 0.9768117070198059, + 0.9920803308486938, + 0.9928614497184753, + 0.9662984609603882, + 0.30733174085617065, + 0.04957903176546097, + 0.05429871752858162, + 0.02710764855146408, + 1.030903697013855 + ] + } + } +} diff --git a/s3/provenance.json b/s3/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..1f3fa7dae0b4a600847f084bdf5e04604639885e --- /dev/null +++ b/s3/provenance.json @@ -0,0 +1,32 @@ +{ + "schema_version": 1, + "exported_utc": "2026-09-03T00:46:29.898835+00:00", + "seed": 3, + "source_checkpoint": "/flare/fusiondl_aesp/fuse_bd_model/fuse20/runs/fuse29r_s3/best_model.pt", + "source_checkpoint_sha256": "ec8986c56b48bf90ca14a2312d6024ad1541bb04baa64889e54d104ae914b914", + "norms_source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json", + "norms_actuator_space": "physical", + "norms_composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "onnx_opset": 17, + "exporter": "torch.onnx.export (TorchScript, dynamo=False)", + "versions": { + "torch": "2.10.0a0+git449b176", + "python": "3.12.12", + "platform": "Linux-5.14.21-150400.24.235-default-x86_64-with-glibc2.31", + "onnx": "1.22.0", + "onnxruntime": "1.29.0" + }, + "artifacts": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "f2b80d7f732cef7a21eb21e606cf4a3e63aa4a91a9ff6dde789d88e07fcd5418" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "ab580c091de0471edc8454085dcda9c88650e4995be5c2ec6bd7f8b1c87d7786" + } + } +} diff --git a/s4/README.md b/s4/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6035dc25f8782bbd46dc554559a058885a15d67c --- /dev/null +++ b/s4/README.md @@ -0,0 +1,56 @@ +--- +license: mit +library_name: onnx +tags: + - onnx + - fusion + - plasma-physics + - tokamak + - diii-d + - mamba +--- + +# fuse29 — seed 4 + +This is seed 4, one of eight independently trained runs. Seed 0 is the champion and the default; this one exists so you can measure spread across training runs. Unless you are doing that, you want seed 0. + +29-input Mamba-2 pedestal predictor for DIII-D. Raw physical units in, +physical units out. See the [root model card](https://huggingface.co/SCS-Lab/FUSE29-Pedestal-model) +for the full description, I/O contract, accuracy and limitations. + +| | | +|---|---| +| Seed | 4 | +| Parameters | 11,254,425 | +| Best validation loss | 1.1321 | +| Sequence graph length | 256 ticks | +| ONNX opset | 17 | +| Exported | 2026-09-03T00:46:32.537210+00:00 | +| Source checkpoint SHA-256 | `d36f1364948aded5…` | + +## Load + +```python +from fuse29.runtime import Fuse29Predictor + +predictor = Fuse29Predictor.from_pretrained("SCS-Lab/FUSE29-Pedestal-model", seed=4) +``` + +## Files + +| File | | +|---|---| +| `fuse29_step.onnx` | one 50 ms tick, carries state, no length limit | +| `fuse29_seq.onnx` | whole shot at a fixed 256 ticks | +| `model_config.json` | I/O contract: names, order, units, sources, shapes | +| `norms.json` | the statistics baked into the graphs | +| `actuator_ranges.json` | training-split distribution, for checking your units | +| `provenance.json` | source checkpoint hash, library versions, artefact hashes | + +## Before you use it + +- Four heads (`neped_prmtan`, `teped_prmtan`, `rho_sym`, `ne_top_loc`) are + **only valid in H-mode** and the graph does not gate them. Gate on the + model's own `hmode` output. +- `pinj` is in **MW**, not W. Run `predictor.check_units(shot)` once. +- Output column order is not alphabetical. See `model_config.json`. diff --git a/s4/actuator_ranges.json b/s4/actuator_ranges.json new file mode 100644 index 0000000000000000000000000000000000000000..08d19f4e80f49e6bbd18c40674b06946a02cc61a --- /dev/null +++ b/s4/actuator_ranges.json @@ -0,0 +1,600 @@ +{ + "schema_version": 1, + "note": "Physical-units distribution of each actuator over the training split. Use it to check that your signals are in the units the graph expects; a unit error is the one preprocessing mistake that produces confident nonsense rather than an exception.", + "split": "train", + "n_shots": 32731, + "n_ticks": 3020926, + "percentiles": [ + 0.1, + 1, + 5, + 25, + 50, + 75, + 95, + 99, + 99.9 + ], + "channels": { + "pinj": { + "units": "MW", + "source": "ptdata:bmspinj", + "description": "Neutral beam injected power, all sources.", + "min": -46005.02701919088, + "max": 17.512712760455507, + "mean": 3.838883638381958, + "std": 3.0613932609558105, + "pct": { + "0.1": -0.004132416388869853, + "1": 4.112187479421436e-09, + "5": 4.112187479421436e-09, + "25": 1.311169336894574, + "50": 3.18466408866965, + "75": 5.748764762873332, + "95": 9.841882532311711, + "99": 12.212702351352696, + "99.9": 14.791924355083399 + } + }, + "tinj": { + "units": "N*m", + "source": "ptdata:bmstinj", + "description": "Neutral beam injected torque, all sources.", + "min": -56.644382966354534, + "max": 129.9833380295058, + "mean": 2.2043209075927734, + "std": 2.11222505569458, + "pct": { + "0.1": -2.0636791725994676, + "1": -0.5384317586520496, + "5": -1.6338495756329507e-07, + "25": 0.4319133403840452, + "50": 1.963846077087278, + "75": 3.1821234334199193, + "95": 6.641525317445799, + "99": 8.941231792062355, + "99.9": 11.156712776956862 + } + }, + "ech_total": { + "units": "MW", + "source": "ptdata:ECHPWR", + "description": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "min": -19.31181996542309, + "max": 40.286455582885246, + "mean": 2.6981112957000732, + "std": 6.685519218444824, + "pct": { + "0.1": -1.0663586061709935, + "1": -0.09982622583332723, + "5": -0.020836448436920674, + "25": -3.2566890961760464e-08, + "50": -3.2566890961760464e-08, + "75": 1.1717011943616973, + "95": 21.558252060431304, + "99": 30.476182922859127, + "99.9": 37.09168917133024 + } + }, + "f1a": { + "units": "A", + "source": "ptdata:F1A", + "description": "Shaping F-coil F1A current (bank A).", + "min": -5776.925892871883, + "max": 5794.3504737288395, + "mean": -1382.3704833984375, + "std": 1349.629638671875, + "pct": { + "0.1": -4852.691808601986, + "1": -4131.456225748339, + "5": -3401.8604035239678, + "25": -2236.4754469921672, + "50": -1501.5458201268116, + "75": -660.4245966463927, + "95": 1294.4315819071094, + "99": 3103.250955923345, + "99.9": 4467.289606367005 + } + }, + "f2a": { + "units": "A", + "source": "ptdata:F2A", + "description": "Shaping F-coil F2A current (bank A).", + "min": -5716.347659616551, + "max": 5702.840977614059, + "mean": -1229.876708984375, + "std": 1248.3497314453125, + "pct": { + "0.1": -4093.397230708888, + "1": -3297.8668360449756, + "5": -2712.522533155646, + "25": -2004.455454331444, + "50": -1443.842241803098, + "75": -854.5004209979342, + "95": 1825.579117167513, + "99": 3097.0902901803724, + "99.9": 3899.548655232026 + } + }, + "f3a": { + "units": "A", + "source": "ptdata:F3A", + "description": "Shaping F-coil F3A current (bank A).", + "min": -5498.272347966228, + "max": 5321.719922394657, + "mean": -592.7352294921875, + "std": 1185.706298828125, + "pct": { + "0.1": -4140.690909683277, + "1": -3539.2136012211317, + "5": -2813.2888996278725, + "25": -1377.7435033975407, + "50": -152.16189816331342, + "75": 2.4453898354848604, + "95": 1203.107532773337, + "99": 2898.3184344684487, + "99.9": 3780.0556837479485 + } + }, + "f4a": { + "units": "A", + "source": "ptdata:F4A", + "description": "Shaping F-coil F4A current (bank A).", + "min": -5876.373800845117, + "max": 5855.700219305917, + "mean": 1098.1622314453125, + "std": 1368.95458984375, + "pct": { + "0.1": -4331.218505807293, + "1": -3344.4526378786877, + "5": -1858.4157962413597, + "25": 395.84891116184133, + "50": 1143.436262581068, + "75": 1990.2677717095535, + "95": 3141.5448401142426, + "99": 3756.430079500399, + "99.9": 4525.754910416766 + } + }, + "f5a": { + "units": "A", + "source": "ptdata:F5A", + "description": "Shaping F-coil F5A current (bank A).", + "min": -5178.8539079385355, + "max": 5353.141466672798, + "mean": 1173.57958984375, + "std": 1352.103759765625, + "pct": { + "0.1": -4592.7059148331355, + "1": -3597.7201189044818, + "5": -1551.4942446467403, + "25": 543.836095032849, + "50": 1273.969119983141, + "75": 2051.0443148459794, + "95": 3019.669622905384, + "99": 3875.454685744494, + "99.9": 4738.506855960392 + } + }, + "f6a": { + "units": "A", + "source": "ptdata:F6A", + "description": "Shaping F-coil F6A current (bank A).", + "min": -7929.903731492232, + "max": 5741.056818467809, + "mean": -2493.411865234375, + "std": 1867.8076171875, + "pct": { + "0.1": -6125.90268588119, + "1": -4963.398523516425, + "5": -4319.477588996284, + "25": -3574.8234234024885, + "50": -2898.635802832382, + "75": -2143.0930801744807, + "95": 2999.75903843203, + "99": 4137.6543157735705, + "99.9": 4783.375582166487 + } + }, + "f7a": { + "units": "A", + "source": "ptdata:F7A", + "description": "Shaping F-coil F7A current (bank A).", + "min": -9825.736080045011, + "max": 8678.484606762057, + "mean": -2367.570556640625, + "std": 1999.19970703125, + "pct": { + "0.1": -7676.219824168618, + "1": -6127.379912259545, + "5": -4909.893927511103, + "25": -3430.1309476786882, + "50": -2697.460342263373, + "75": -1913.0579478721388, + "95": 2723.164038733837, + "99": 3948.221013655396, + "99.9": 5316.086800760559 + } + }, + "f8a": { + "units": "A", + "source": "ptdata:F8A", + "description": "Shaping F-coil F8A current (bank A).", + "min": -5378.835169240788, + "max": 5880.767402237174, + "mean": 996.0214233398438, + "std": 1498.948974609375, + "pct": { + "0.1": -4229.744640827867, + "1": -3363.368412210415, + "5": -1922.2114690963926, + "25": 60.761390529545906, + "50": 1153.9241798399726, + "75": 1951.1572686642544, + "95": 3318.078493605748, + "99": 3973.7764489149104, + "99.9": 4670.296725684707 + } + }, + "f9a": { + "units": "A", + "source": "ptdata:F9A", + "description": "Shaping F-coil F9A current (bank A).", + "min": -7206.032812499594, + "max": 8700.684616308497, + "mean": -535.8018798828125, + "std": 1258.01171875, + "pct": { + "0.1": -4739.927394914494, + "1": -3344.557163847978, + "5": -2567.420669960383, + "25": -1538.6304412830955, + "50": -578.9736547563273, + "75": 353.08467764596537, + "95": 1558.2607279613098, + "99": 2657.691791383836, + "99.9": 4334.930796170508 + } + }, + "f1b": { + "units": "A", + "source": "ptdata:F1B", + "description": "Shaping F-coil F1B current (bank B).", + "min": -5921.943154546981, + "max": 5407.326196618229, + "mean": -1373.1888427734375, + "std": 1367.82275390625, + "pct": { + "0.1": -5179.567735964654, + "1": -4339.478258925401, + "5": -3463.431883510691, + "25": -2205.922070942479, + "50": -1459.5306304510002, + "75": -750.1948036110768, + "95": 1428.796834935177, + "99": 3233.0438718527407, + "99.9": 4240.724502122051 + } + }, + "f2b": { + "units": "A", + "source": "ptdata:F2B", + "description": "Shaping F-coil F2B current (bank B).", + "min": -5788.286812358208, + "max": 5428.562849130928, + "mean": -1218.50048828125, + "std": 1316.67724609375, + "pct": { + "0.1": -4785.998935671587, + "1": -3520.521383204173, + "5": -2855.1671089762676, + "25": -1969.483606794242, + "50": -1447.1879016413761, + "75": -866.6265611311096, + "95": 2049.217650390811, + "99": 3312.4349928765846, + "99.9": 4011.5142868858347 + } + }, + "f3b": { + "units": "A", + "source": "ptdata:F3B", + "description": "Shaping F-coil F3B current (bank B).", + "min": -5503.943071765381, + "max": 4849.177948074737, + "mean": -1005.3848266601562, + "std": 1308.8258056640625, + "pct": { + "0.1": -4452.6277480541985, + "1": -3641.634707712471, + "5": -2937.4861003450947, + "25": -1881.7475544966392, + "50": -1170.6945714968547, + "75": -124.13671681902403, + "95": 1683.5400540223286, + "99": 3015.8060365193123, + "99.9": 3797.6599244161957 + } + }, + "f4b": { + "units": "A", + "source": "ptdata:F4B", + "description": "Shaping F-coil F4B current (bank B).", + "min": -5829.242194941551, + "max": 5787.149431930685, + "mean": 1124.2967529296875, + "std": 1519.5994873046875, + "pct": { + "0.1": -4083.976449898858, + "1": -3247.08251902718, + "5": -2270.942268479742, + "25": 376.8608226937906, + "50": 1392.450441038166, + "75": 2146.7001303629104, + "95": 3145.5476189867913, + "99": 3926.614817946318, + "99.9": 4582.551950710075 + } + }, + "f5b": { + "units": "A", + "source": "ptdata:F5B", + "description": "Shaping F-coil F5B current (bank B).", + "min": -5213.110339059254, + "max": 5388.213772287713, + "mean": 1443.536865234375, + "std": 1408.3306884765625, + "pct": { + "0.1": -4134.61747806435, + "1": -3056.873937432705, + "5": -1361.0988601293998, + "25": 675.1515533174199, + "50": 1572.802070225599, + "75": 2367.5452263604984, + "95": 3528.863240540377, + "99": 4411.454242162536, + "99.9": 4967.30642206674 + } + }, + "f6b": { + "units": "A", + "source": "ptdata:F6B", + "description": "Shaping F-coil F6B current (bank B).", + "min": -7604.653108484432, + "max": 7763.1261416792295, + "mean": -2463.248046875, + "std": 1836.4208984375, + "pct": { + "0.1": -6372.627428710043, + "1": -5251.4106280007745, + "5": -4318.157196234368, + "25": -3524.5849152058445, + "50": -2837.2759930056304, + "75": -2089.94465303326, + "95": 2871.6849973390945, + "99": 3948.010461650111, + "99.9": 4803.251616324593 + } + }, + "f7b": { + "units": "A", + "source": "ptdata:F7B", + "description": "Shaping F-coil F7B current (bank B).", + "min": -11380.254539563213, + "max": 9414.242772782009, + "mean": -2941.56005859375, + "std": 2510.1083984375, + "pct": { + "0.1": -9236.286164628174, + "1": -7962.01372128499, + "5": -6618.689743738845, + "25": -4397.68407591947, + "50": -3041.7944101983817, + "75": -2113.0768216001165, + "95": 2850.240503964187, + "99": 5238.131223534479, + "99.9": 6771.41582857779 + } + }, + "f8b": { + "units": "A", + "source": "ptdata:F8B", + "description": "Shaping F-coil F8B current (bank B).", + "min": -5834.457886045129, + "max": 5952.292180058913, + "mean": 1431.05615234375, + "std": 1718.2965087890625, + "pct": { + "0.1": -4377.886849186064, + "1": -3547.8568327724756, + "5": -2536.325388000092, + "25": 592.1441487378677, + "50": 1743.1741236182588, + "75": 2613.9050347435855, + "95": 3655.019608301406, + "99": 4295.252919476556, + "99.9": 5183.621783504976 + } + }, + "f9b": { + "units": "A", + "source": "ptdata:F9B", + "description": "Shaping F-coil F9B current (bank B).", + "min": -7298.33418485197, + "max": 8673.475372842513, + "mean": -214.02586364746094, + "std": 1388.83447265625, + "pct": { + "0.1": -4443.002941036773, + "1": -3335.961239603393, + "5": -2530.3434455144015, + "25": -1111.6205754278508, + "50": -212.41719832099042, + "75": 564.1401009862525, + "95": 2296.158459733251, + "99": 3401.023805016151, + "99.9": 4981.695296538042 + } + }, + "ecoila": { + "units": "A", + "source": "ptdata:ECOILA", + "description": "Ohmic E-coil bank A current.", + "min": -68526.67779690563, + "max": 65669.33446503483, + "mean": -6965.32666015625, + "std": 18940.9453125, + "pct": { + "0.1": -62521.0592220894, + "1": -53449.0677376177, + "5": -39610.65329064206, + "25": -19599.348704727538, + "50": -6887.604056684089, + "75": 6065.040591650557, + "95": 23926.96154448237, + "99": 33650.27142286909, + "99.9": 48164.54971213867 + } + }, + "ecoilb": { + "units": "A", + "source": "ptdata:ECOILB", + "description": "Ohmic E-coil bank B current.", + "min": -67880.78461590248, + "max": 67380.80764904841, + "mean": -6876.16455078125, + "std": 18723.662109375, + "pct": { + "0.1": -61839.528701402356, + "1": -52787.079189397904, + "5": -39153.2527665565, + "25": -19383.82435886666, + "50": -6768.996463787789, + "75": 6013.297288247475, + "95": 23686.641557508636, + "99": 33187.653018934754, + "99.9": 47362.43837391052 + } + }, + "gasa_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "description": "Calibrated gas injection flow, valve A.", + "min": -0.9805486760911233, + "max": 348.1779045740827, + "mean": 15.054444313049316, + "std": 26.369497299194336, + "pct": { + "0.1": -0.0181447514768128, + "1": 0.0006228885411054819, + "5": 0.0014589414841879034, + "25": 0.00852798057103854, + "50": 0.09974314587981326, + "75": 19.645558552678416, + "95": 71.02669389337856, + "99": 137.36341388263276, + "99.9": 211.79616738152396 + } + }, + "gasb_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "description": "Calibrated gas injection flow, valve B.", + "min": -0.5231055139632899, + "max": 317.69717326145866, + "mean": 1.386172890663147, + "std": 3.4090511798858643, + "pct": { + "0.1": 9.14047308575583e-06, + "1": 0.0007714573310613204, + "5": 0.002068321612864521, + "25": 0.009055124211873267, + "50": 0.07339015461169385, + "75": 1.9421402622606716, + "95": 1.9421402622606716, + "99": 23.663863921838843, + "99.9": 149.40068998150738 + } + }, + "gasc_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "description": "Calibrated gas injection flow, valve C.", + "min": -0.3965804467767108, + "max": 306.0269668007428, + "mean": 0.35034820437431335, + "std": 0.4470684826374054, + "pct": { + "0.1": 7.428448363699935e-05, + "1": 0.00026770734685732656, + "5": 0.0006667805693404416, + "25": 0.002788385500787083, + "50": 0.023577950502740697, + "75": 0.7508911827356307, + "95": 0.7508911827356307, + "99": 2.733332630282, + "99.9": 108.67323889612304 + } + }, + "gasd_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "description": "Calibrated gas injection flow, valve D.", + "min": -0.5287260135880842, + "max": 771.5043798529183, + "mean": 0.528103232383728, + "std": 0.654624342918396, + "pct": { + "0.1": 5.497087182604332e-05, + "1": 0.000175335120693898, + "5": 0.0005482846440516553, + "25": 0.003719433481388368, + "50": 0.08385269566973214, + "75": 1.0383906373403984, + "95": 1.0383906373403984, + "99": 4.359676988215197, + "99.9": 127.54440071212512 + } + }, + "gase_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "description": "Calibrated gas injection flow, valve E.", + "min": -0.2211384331710633, + "max": 672.8582070151267, + "mean": 0.27696067094802856, + "std": 0.17616958916187286, + "pct": { + "0.1": 0.00010156410138473793, + "1": 0.000223585566083373, + "5": 0.0005190716405260032, + "25": 0.011627604901727706, + "50": 0.3920832239686922, + "75": 0.3920832239686922, + "95": 0.3920832239686922, + "99": 0.3920832239686922, + "99.9": 29.75536079519976 + } + }, + "bt": { + "units": "T", + "source": "ptdata:bt", + "description": "Vacuum toroidal magnetic field (signed).", + "min": -2.2353815075115375, + "max": 2.25186423641397, + "mean": -0.971906840801239, + "std": 1.6484158039093018, + "pct": { + "0.1": -2.2151064134142304, + "1": -2.1819873443702726, + "5": -2.136304350652244, + "25": -2.0446028795017246, + "50": -1.8984274308309796, + "75": -1.0260122281948352, + "95": 2.053318112027725, + "99": 2.10945640328767, + "99.9": 2.1819705410137904 + } + } + } +} diff --git a/s4/fuse29_seq.onnx b/s4/fuse29_seq.onnx new file mode 100644 index 0000000000000000000000000000000000000000..f3509f74a89a7848ed1dee0159b0a620fc894ae1 --- /dev/null +++ b/s4/fuse29_seq.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2348d2e1930835363dfade74cfc47d46c88e0691693f60e85cffc2d459ecf774 +size 45464382 diff --git a/s4/fuse29_step.onnx b/s4/fuse29_step.onnx new file mode 100644 index 0000000000000000000000000000000000000000..3a8486e14cdb2da016d836068a61c2f7ee32baa4 --- /dev/null +++ b/s4/fuse29_step.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c74bffd61e2c69cae1b8b182fbde8897ce971901d83beded7f6a2e0c919fedc +size 45081271 diff --git a/s4/model_config.json b/s4/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..2b6e71352f1e280451065445e907d4680f883ff0 --- /dev/null +++ b/s4/model_config.json @@ -0,0 +1,268 @@ +{ + "schema_version": 1, + "model": "fuse29", + "seed": 4, + "description": "29-input Mamba-2 pedestal predictor for DIII-D. Strictly causal, 20 Hz, nine heads at rho_tor = 0.85.", + "architecture": { + "family": "Mamba-2 (structured state-space duality)", + "d_model": 512, + "n_layers": 6, + "d_state": 128, + "d_conv": 4, + "expand": 2, + "headdim": 128, + "nheads": 8, + "ngroups": 2, + "chunk_size": 100, + "d_inner": 1024, + "conv_dim": 1536, + "n_params": 11254425 + }, + "cadence": { + "hz": 20, + "period_ms": 50.0, + "rho_tor": 0.85 + }, + "inputs": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "n": 29, + "units": { + "pinj": "MW", + "tinj": "N*m", + "ech_total": "MW", + "f1a": "A", + "f2a": "A", + "f3a": "A", + "f4a": "A", + "f5a": "A", + "f6a": "A", + "f7a": "A", + "f8a": "A", + "f9a": "A", + "f1b": "A", + "f2b": "A", + "f3b": "A", + "f4b": "A", + "f5b": "A", + "f6b": "A", + "f7b": "A", + "f8b": "A", + "f9b": "A", + "ecoila": "A", + "ecoilb": "A", + "gasa_cal": "Torr*L/s", + "gasb_cal": "Torr*L/s", + "gasc_cal": "Torr*L/s", + "gasd_cal": "Torr*L/s", + "gase_cal": "Torr*L/s", + "bt": "T" + }, + "sources": { + "pinj": "ptdata:bmspinj", + "tinj": "ptdata:bmstinj", + "ech_total": "ptdata:ECHPWR", + "f1a": "ptdata:F1A", + "f2a": "ptdata:F2A", + "f3a": "ptdata:F3A", + "f4a": "ptdata:F4A", + "f5a": "ptdata:F5A", + "f6a": "ptdata:F6A", + "f7a": "ptdata:F7A", + "f8a": "ptdata:F8A", + "f9a": "ptdata:F9A", + "f1b": "ptdata:F1B", + "f2b": "ptdata:F2B", + "f3b": "ptdata:F3B", + "f4b": "ptdata:F4B", + "f5b": "ptdata:F5B", + "f6b": "ptdata:F6B", + "f7b": "ptdata:F7B", + "f8b": "ptdata:F8B", + "f9b": "ptdata:F9B", + "ecoila": "ptdata:ECOILA", + "ecoilb": "ptdata:ECOILB", + "gasa_cal": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "gasb_cal": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "gasc_cal": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "gasd_cal": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "gase_cal": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "bt": "ptdata:bt" + }, + "descriptions": { + "pinj": "Neutral beam injected power, all sources.", + "tinj": "Neutral beam injected torque, all sources.", + "ech_total": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "f1a": "Shaping F-coil F1A current (bank A).", + "f2a": "Shaping F-coil F2A current (bank A).", + "f3a": "Shaping F-coil F3A current (bank A).", + "f4a": "Shaping F-coil F4A current (bank A).", + "f5a": "Shaping F-coil F5A current (bank A).", + "f6a": "Shaping F-coil F6A current (bank A).", + "f7a": "Shaping F-coil F7A current (bank A).", + "f8a": "Shaping F-coil F8A current (bank A).", + "f9a": "Shaping F-coil F9A current (bank A).", + "f1b": "Shaping F-coil F1B current (bank B).", + "f2b": "Shaping F-coil F2B current (bank B).", + "f3b": "Shaping F-coil F3B current (bank B).", + "f4b": "Shaping F-coil F4B current (bank B).", + "f5b": "Shaping F-coil F5B current (bank B).", + "f6b": "Shaping F-coil F6B current (bank B).", + "f7b": "Shaping F-coil F7B current (bank B).", + "f8b": "Shaping F-coil F8B current (bank B).", + "f9b": "Shaping F-coil F9B current (bank B).", + "ecoila": "Ohmic E-coil bank A current.", + "ecoilb": "Ohmic E-coil bank B current.", + "gasa_cal": "Calibrated gas injection flow, valve A.", + "gasb_cal": "Calibrated gas injection flow, valve B.", + "gasc_cal": "Calibrated gas injection flow, valve C.", + "gasd_cal": "Calibrated gas injection flow, valve D.", + "gase_cal": "Calibrated gas injection flow, valve E.", + "bt": "Vacuum toroidal magnetic field (signed)." + }, + "space": "raw physical units; the graph applies the z-score", + "note": "Check your units against actuator_ranges.json before trusting any output. A unit error produces confident nonsense rather than an exception." + }, + "outputs": { + "names": [ + "ne", + "te_ped", + "ti_ped", + "t_rot_ped", + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc", + "hmode" + ], + "n": 9, + "units": { + "ne": "1e19 m^-3", + "te_ped": "keV", + "ti_ped": "keV", + "t_rot_ped": "krad/s", + "neped_prmtan": "1e19 m^-3", + "teped_prmtan": "keV", + "rho_sym": "rho_tor (dimensionless)", + "ne_top_loc": "rho_tor (dimensionless)", + "hmode": "probability in [0, 1]" + }, + "note": "Physical units. hmode is a probability in [0, 1]; the graph applies the sigmoid.", + "hmode_gated": { + "heads": [ + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc" + ], + "indices": [ + 4, + 5, + 6, + 7 + ], + "threshold": 0.5, + "note": "These four heads were trained only on H-mode rows and are undefined otherwise. The graph does NOT gate them; the consumer must, using the model's own hmode output. See docs/GATING.md." + } + }, + "graphs": { + "fuse29_step.onnx": { + "purpose": "real-time, one 50 ms tick per call", + "inputs": { + "actuators": [ + "batch", + 29 + ], + "conv_state": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "outputs": { + "predictions": [ + "batch", + 9 + ], + "conv_state_out": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state_out": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "initial_state": "all zeros at the start of a shot", + "max_shot_length": "unbounded" + }, + "fuse29_seq.onnx": { + "purpose": "offline scoring of a whole shot", + "inputs": { + "actuators": [ + "batch", + 256, + 29 + ] + }, + "outputs": { + "predictions": [ + "batch", + 256, + 9 + ] + }, + "seq_len": 256, + "note": "Sequence length is FIXED. Right-pad shorter shots with zeros and read the first T outputs; the model is strictly causal so this is exact. For longer shots use the step graph or re-export with --seq-len." + } + }, + "dtype": "float32", + "onnx_opset": 17, + "training": { + "epoch": 22, + "val_loss": 1.1320768278092146, + "note": "See docs/TRAINING.md for the full recipe." + } +} diff --git a/s4/norms.json b/s4/norms.json new file mode 100644 index 0000000000000000000000000000000000000000..98c8c06209fd050ed78c21fa5b30afd95a71c171 --- /dev/null +++ b/s4/norms.json @@ -0,0 +1,292 @@ +{ + "schema_version": 2, + "note": "Statistics are baked into the shipped ONNX graphs. This file is for inspection and for reproducing the transform outside the graph; it is not required at inference time.", + "actuator_space": "physical", + "std_floor": 1e-06, + "clip_sigma": 20.0, + "provenance": { + "split": "train", + "n_shots": 32731, + "rho_index": 85, + "source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85, random stratified split (split_index.json)", + "note": "Recomputed on the NEW random train split. The source shards carried z-scores from the OLD chronological train split, whose shots overlap our test set. Actuator statistics are winsorised so a corrupted sample cannot set a channel's divisor.", + "inflated_channels": [ + "pinj", + "gasc_cal", + "gasd_cal", + "gase_cal" + ], + "actuator_estimator": "winsorised to p1..p99", + "actuator_space": "physical", + "composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "composition": "z = (x_phys - (m1 + s1*m2)) / (s1*s2), where (m1, s1) is the upstream FPE z-score and (m2, s2) is this model's re-scale onto its own training split" + }, + "actuators": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "mean": [ + 3.838883638381958, + 2.2043209075927734, + 2.6981112957000732, + -1382.3704833984375, + -1229.876708984375, + -592.7352294921875, + 1098.1622314453125, + 1173.57958984375, + -2493.411865234375, + -2367.570556640625, + 996.0214233398438, + -535.8018798828125, + -1373.1888427734375, + -1218.50048828125, + -1005.3848266601562, + 1124.2967529296875, + 1443.536865234375, + -2463.248046875, + -2941.56005859375, + 1431.05615234375, + -214.02586364746094, + -6965.32666015625, + -6876.16455078125, + 15.054444313049316, + 1.386172890663147, + 0.35034820437431335, + 0.528103232383728, + 0.27696067094802856, + -0.971906840801239 + ], + "std": [ + 3.0613932609558105, + 2.11222505569458, + 6.685519218444824, + 1349.629638671875, + 1248.3497314453125, + 1185.706298828125, + 1368.95458984375, + 1352.103759765625, + 1867.8076171875, + 1999.19970703125, + 1498.948974609375, + 1258.01171875, + 1367.82275390625, + 1316.67724609375, + 1308.8258056640625, + 1519.5994873046875, + 1408.3306884765625, + 1836.4208984375, + 2510.1083984375, + 1718.2965087890625, + 1388.83447265625, + 18940.9453125, + 18723.662109375, + 26.369497299194336, + 3.4090511798858643, + 0.4470684826374054, + 0.654624342918396, + 0.17616958916187286, + 1.6484158039093018 + ], + "transform": "z = clip((x - mean) / std, -clip_sigma, +clip_sigma), applied inside the graph" + }, + "targets": { + "ne": { + "mean": 2.7511744499206543, + "std": 1.654153823852539 + }, + "te_ped": { + "mean": 0.5915626287460327, + "std": 0.43467429280281067 + }, + "ti_ped": { + "mean": 1.016850233078003, + "std": 0.681096076965332 + }, + "t_rot_ped": { + "mean": 21.244613647460938, + "std": 16.59148406982422 + }, + "neped_prmtan": { + "mean": 2.7231285572052, + "std": 1.7005536556243896 + }, + "teped_prmtan": { + "mean": 0.46375223994255066, + "std": 0.36919456720352173 + }, + "rho_sym": { + "mean": 0.9757616519927979, + "std": 0.04329206794500351 + }, + "ne_top_loc": { + "mean": 0.9261865019798279, + "std": 0.049897171556949615 + } + }, + "hmode": { + "transform": "sigmoid", + "note": "hmode is a logit in the trunk; the graph applies the sigmoid." + }, + "stages": { + "note": "The composed actuator statistics above are the product of these two. Shown for traceability; use the composed values.", + "stage1_physical_to_fpe_zscore": { + "mean": [ + 2.8111997039100878, + 2.154143940948575, + 2.159654935239209, + -1444.0438445123289, + -1315.1185221229061, + -639.741760304047, + 1172.4978680515835, + 1222.4970107268077, + -2488.8410961768263, + -2491.3739557685253, + 1050.107386405324, + -578.9736547563273, + -1421.0817159358041, + -1285.3967398730092, + -1061.0290851406676, + 1186.4795970820587, + 1460.6822372728345, + -2452.093120847959, + -3071.3132492215186, + 1531.3304960724108, + -262.6728625067526, + -6887.604056684089, + -6768.996463787789, + 14.89178144369171, + 1.9421402622606716, + 0.7508911827356307, + 1.0383906373403984, + 0.3920832239686922, + -1.0310375752078498 + ], + "std": [ + 194.08418888726106, + 2.3684465859740262, + 5.948083564785035, + 1267.4907621702682, + 1217.4478106828162, + 1249.3915272640536, + 1345.3871181128568, + 1359.1934832307923, + 1887.1891497052302, + 1888.1014577442652, + 1559.9875106371376, + 1287.2118470203372, + 1271.813282654729, + 1259.8644805335082, + 1361.9306367877398, + 1521.172083160852, + 1393.2120473032558, + 1856.723912629122, + 2432.8530409799628, + 1705.6959050005082, + 1421.8036451037203, + 19092.148992270486, + 18858.28389193975, + 27.289184462156058, + 11.092415079529571, + 9.017289768908354, + 12.055982101097918, + 6.498888909025979, + 1.599000778986496 + ] + }, + "stage2_fpe_zscore_to_model": { + "mean": [ + 0.0052950419485569, + 0.02118559367954731, + 0.0905260294675827, + 0.04865782707929611, + 0.0700167864561081, + 0.03762352466583252, + -0.05525219440460205, + -0.03599006310105324, + -0.002421961398795247, + 0.06557027250528336, + -0.03467077016830444, + 0.03353898227214813, + 0.03765711933374405, + 0.05309795215725899, + 0.040856875479221344, + -0.04087827727198601, + -0.012306398712098598, + -0.006007813848555088, + 0.05333370715379715, + -0.05878793075680733, + 0.03421499580144882, + -0.004070908762514591, + -0.00568280229344964, + 0.005960696842521429, + -0.050121404230594635, + -0.04441944137215614, + -0.042326491326093674, + -0.017714189365506172, + 0.036979787051677704 + ], + "std": [ + 0.015773532912135124, + 0.8918187022209167, + 1.1239787340164185, + 1.0648043155670166, + 1.0253825187683105, + 0.9490270018577576, + 1.0175172090530396, + 0.994783878326416, + 0.9897299408912659, + 1.0588412284851074, + 0.9608724117279053, + 0.9773152470588684, + 1.0754902362823486, + 1.04509437084198, + 0.9610077142715454, + 0.9989661574363708, + 1.0108516216278076, + 0.9890651702880859, + 1.0317550897598267, + 1.007387399673462, + 0.9768117070198059, + 0.9920803308486938, + 0.9928614497184753, + 0.9662984609603882, + 0.30733174085617065, + 0.04957903176546097, + 0.05429871752858162, + 0.02710764855146408, + 1.030903697013855 + ] + } + } +} diff --git a/s4/provenance.json b/s4/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..fe6eb96076cd87eb905c831de963af40e109477f --- /dev/null +++ b/s4/provenance.json @@ -0,0 +1,32 @@ +{ + "schema_version": 1, + "exported_utc": "2026-09-03T00:46:32.537210+00:00", + "seed": 4, + "source_checkpoint": "/flare/fusiondl_aesp/fuse_bd_model/fuse20/runs/fuse29r_s4/best_model.pt", + "source_checkpoint_sha256": "d36f1364948aded5be459beb9a7670d59366272471c4f8ef36338135d8242104", + "norms_source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json", + "norms_actuator_space": "physical", + "norms_composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "onnx_opset": 17, + "exporter": "torch.onnx.export (TorchScript, dynamo=False)", + "versions": { + "torch": "2.10.0a0+git449b176", + "python": "3.12.12", + "platform": "Linux-5.14.21-150400.24.235-default-x86_64-with-glibc2.31", + "onnx": "1.22.0", + "onnxruntime": "1.29.0" + }, + "artifacts": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "7c74bffd61e2c69cae1b8b182fbde8897ce971901d83beded7f6a2e0c919fedc" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "2348d2e1930835363dfade74cfc47d46c88e0691693f60e85cffc2d459ecf774" + } + } +} diff --git a/s5/README.md b/s5/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ae99ccd96c76158d0ae23f586fd862707db526a0 --- /dev/null +++ b/s5/README.md @@ -0,0 +1,56 @@ +--- +license: mit +library_name: onnx +tags: + - onnx + - fusion + - plasma-physics + - tokamak + - diii-d + - mamba +--- + +# fuse29 — seed 5 + +This is seed 5, one of eight independently trained runs. Seed 0 is the champion and the default; this one exists so you can measure spread across training runs. Unless you are doing that, you want seed 0. + +29-input Mamba-2 pedestal predictor for DIII-D. Raw physical units in, +physical units out. See the [root model card](https://huggingface.co/SCS-Lab/FUSE29-Pedestal-model) +for the full description, I/O contract, accuracy and limitations. + +| | | +|---|---| +| Seed | 5 | +| Parameters | 11,254,425 | +| Best validation loss | 1.1122 | +| Sequence graph length | 256 ticks | +| ONNX opset | 17 | +| Exported | 2026-09-03T00:46:35.316400+00:00 | +| Source checkpoint SHA-256 | `d01cae015ed05e7e…` | + +## Load + +```python +from fuse29.runtime import Fuse29Predictor + +predictor = Fuse29Predictor.from_pretrained("SCS-Lab/FUSE29-Pedestal-model", seed=5) +``` + +## Files + +| File | | +|---|---| +| `fuse29_step.onnx` | one 50 ms tick, carries state, no length limit | +| `fuse29_seq.onnx` | whole shot at a fixed 256 ticks | +| `model_config.json` | I/O contract: names, order, units, sources, shapes | +| `norms.json` | the statistics baked into the graphs | +| `actuator_ranges.json` | training-split distribution, for checking your units | +| `provenance.json` | source checkpoint hash, library versions, artefact hashes | + +## Before you use it + +- Four heads (`neped_prmtan`, `teped_prmtan`, `rho_sym`, `ne_top_loc`) are + **only valid in H-mode** and the graph does not gate them. Gate on the + model's own `hmode` output. +- `pinj` is in **MW**, not W. Run `predictor.check_units(shot)` once. +- Output column order is not alphabetical. See `model_config.json`. diff --git a/s5/actuator_ranges.json b/s5/actuator_ranges.json new file mode 100644 index 0000000000000000000000000000000000000000..08d19f4e80f49e6bbd18c40674b06946a02cc61a --- /dev/null +++ b/s5/actuator_ranges.json @@ -0,0 +1,600 @@ +{ + "schema_version": 1, + "note": "Physical-units distribution of each actuator over the training split. Use it to check that your signals are in the units the graph expects; a unit error is the one preprocessing mistake that produces confident nonsense rather than an exception.", + "split": "train", + "n_shots": 32731, + "n_ticks": 3020926, + "percentiles": [ + 0.1, + 1, + 5, + 25, + 50, + 75, + 95, + 99, + 99.9 + ], + "channels": { + "pinj": { + "units": "MW", + "source": "ptdata:bmspinj", + "description": "Neutral beam injected power, all sources.", + "min": -46005.02701919088, + "max": 17.512712760455507, + "mean": 3.838883638381958, + "std": 3.0613932609558105, + "pct": { + "0.1": -0.004132416388869853, + "1": 4.112187479421436e-09, + "5": 4.112187479421436e-09, + "25": 1.311169336894574, + "50": 3.18466408866965, + "75": 5.748764762873332, + "95": 9.841882532311711, + "99": 12.212702351352696, + "99.9": 14.791924355083399 + } + }, + "tinj": { + "units": "N*m", + "source": "ptdata:bmstinj", + "description": "Neutral beam injected torque, all sources.", + "min": -56.644382966354534, + "max": 129.9833380295058, + "mean": 2.2043209075927734, + "std": 2.11222505569458, + "pct": { + "0.1": -2.0636791725994676, + "1": -0.5384317586520496, + "5": -1.6338495756329507e-07, + "25": 0.4319133403840452, + "50": 1.963846077087278, + "75": 3.1821234334199193, + "95": 6.641525317445799, + "99": 8.941231792062355, + "99.9": 11.156712776956862 + } + }, + "ech_total": { + "units": "MW", + "source": "ptdata:ECHPWR", + "description": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "min": -19.31181996542309, + "max": 40.286455582885246, + "mean": 2.6981112957000732, + "std": 6.685519218444824, + "pct": { + "0.1": -1.0663586061709935, + "1": -0.09982622583332723, + "5": -0.020836448436920674, + "25": -3.2566890961760464e-08, + "50": -3.2566890961760464e-08, + "75": 1.1717011943616973, + "95": 21.558252060431304, + "99": 30.476182922859127, + "99.9": 37.09168917133024 + } + }, + "f1a": { + "units": "A", + "source": "ptdata:F1A", + "description": "Shaping F-coil F1A current (bank A).", + "min": -5776.925892871883, + "max": 5794.3504737288395, + "mean": -1382.3704833984375, + "std": 1349.629638671875, + "pct": { + "0.1": -4852.691808601986, + "1": -4131.456225748339, + "5": -3401.8604035239678, + "25": -2236.4754469921672, + "50": -1501.5458201268116, + "75": -660.4245966463927, + "95": 1294.4315819071094, + "99": 3103.250955923345, + "99.9": 4467.289606367005 + } + }, + "f2a": { + "units": "A", + "source": "ptdata:F2A", + "description": "Shaping F-coil F2A current (bank A).", + "min": -5716.347659616551, + "max": 5702.840977614059, + "mean": -1229.876708984375, + "std": 1248.3497314453125, + "pct": { + "0.1": -4093.397230708888, + "1": -3297.8668360449756, + "5": -2712.522533155646, + "25": -2004.455454331444, + "50": -1443.842241803098, + "75": -854.5004209979342, + "95": 1825.579117167513, + "99": 3097.0902901803724, + "99.9": 3899.548655232026 + } + }, + "f3a": { + "units": "A", + "source": "ptdata:F3A", + "description": "Shaping F-coil F3A current (bank A).", + "min": -5498.272347966228, + "max": 5321.719922394657, + "mean": -592.7352294921875, + "std": 1185.706298828125, + "pct": { + "0.1": -4140.690909683277, + "1": -3539.2136012211317, + "5": -2813.2888996278725, + "25": -1377.7435033975407, + "50": -152.16189816331342, + "75": 2.4453898354848604, + "95": 1203.107532773337, + "99": 2898.3184344684487, + "99.9": 3780.0556837479485 + } + }, + "f4a": { + "units": "A", + "source": "ptdata:F4A", + "description": "Shaping F-coil F4A current (bank A).", + "min": -5876.373800845117, + "max": 5855.700219305917, + "mean": 1098.1622314453125, + "std": 1368.95458984375, + "pct": { + "0.1": -4331.218505807293, + "1": -3344.4526378786877, + "5": -1858.4157962413597, + "25": 395.84891116184133, + "50": 1143.436262581068, + "75": 1990.2677717095535, + "95": 3141.5448401142426, + "99": 3756.430079500399, + "99.9": 4525.754910416766 + } + }, + "f5a": { + "units": "A", + "source": "ptdata:F5A", + "description": "Shaping F-coil F5A current (bank A).", + "min": -5178.8539079385355, + "max": 5353.141466672798, + "mean": 1173.57958984375, + "std": 1352.103759765625, + "pct": { + "0.1": -4592.7059148331355, + "1": -3597.7201189044818, + "5": -1551.4942446467403, + "25": 543.836095032849, + "50": 1273.969119983141, + "75": 2051.0443148459794, + "95": 3019.669622905384, + "99": 3875.454685744494, + "99.9": 4738.506855960392 + } + }, + "f6a": { + "units": "A", + "source": "ptdata:F6A", + "description": "Shaping F-coil F6A current (bank A).", + "min": -7929.903731492232, + "max": 5741.056818467809, + "mean": -2493.411865234375, + "std": 1867.8076171875, + "pct": { + "0.1": -6125.90268588119, + "1": -4963.398523516425, + "5": -4319.477588996284, + "25": -3574.8234234024885, + "50": -2898.635802832382, + "75": -2143.0930801744807, + "95": 2999.75903843203, + "99": 4137.6543157735705, + "99.9": 4783.375582166487 + } + }, + "f7a": { + "units": "A", + "source": "ptdata:F7A", + "description": "Shaping F-coil F7A current (bank A).", + "min": -9825.736080045011, + "max": 8678.484606762057, + "mean": -2367.570556640625, + "std": 1999.19970703125, + "pct": { + "0.1": -7676.219824168618, + "1": -6127.379912259545, + "5": -4909.893927511103, + "25": -3430.1309476786882, + "50": -2697.460342263373, + "75": -1913.0579478721388, + "95": 2723.164038733837, + "99": 3948.221013655396, + "99.9": 5316.086800760559 + } + }, + "f8a": { + "units": "A", + "source": "ptdata:F8A", + "description": "Shaping F-coil F8A current (bank A).", + "min": -5378.835169240788, + "max": 5880.767402237174, + "mean": 996.0214233398438, + "std": 1498.948974609375, + "pct": { + "0.1": -4229.744640827867, + "1": -3363.368412210415, + "5": -1922.2114690963926, + "25": 60.761390529545906, + "50": 1153.9241798399726, + "75": 1951.1572686642544, + "95": 3318.078493605748, + "99": 3973.7764489149104, + "99.9": 4670.296725684707 + } + }, + "f9a": { + "units": "A", + "source": "ptdata:F9A", + "description": "Shaping F-coil F9A current (bank A).", + "min": -7206.032812499594, + "max": 8700.684616308497, + "mean": -535.8018798828125, + "std": 1258.01171875, + "pct": { + "0.1": -4739.927394914494, + "1": -3344.557163847978, + "5": -2567.420669960383, + "25": -1538.6304412830955, + "50": -578.9736547563273, + "75": 353.08467764596537, + "95": 1558.2607279613098, + "99": 2657.691791383836, + "99.9": 4334.930796170508 + } + }, + "f1b": { + "units": "A", + "source": "ptdata:F1B", + "description": "Shaping F-coil F1B current (bank B).", + "min": -5921.943154546981, + "max": 5407.326196618229, + "mean": -1373.1888427734375, + "std": 1367.82275390625, + "pct": { + "0.1": -5179.567735964654, + "1": -4339.478258925401, + "5": -3463.431883510691, + "25": -2205.922070942479, + "50": -1459.5306304510002, + "75": -750.1948036110768, + "95": 1428.796834935177, + "99": 3233.0438718527407, + "99.9": 4240.724502122051 + } + }, + "f2b": { + "units": "A", + "source": "ptdata:F2B", + "description": "Shaping F-coil F2B current (bank B).", + "min": -5788.286812358208, + "max": 5428.562849130928, + "mean": -1218.50048828125, + "std": 1316.67724609375, + "pct": { + "0.1": -4785.998935671587, + "1": -3520.521383204173, + "5": -2855.1671089762676, + "25": -1969.483606794242, + "50": -1447.1879016413761, + "75": -866.6265611311096, + "95": 2049.217650390811, + "99": 3312.4349928765846, + "99.9": 4011.5142868858347 + } + }, + "f3b": { + "units": "A", + "source": "ptdata:F3B", + "description": "Shaping F-coil F3B current (bank B).", + "min": -5503.943071765381, + "max": 4849.177948074737, + "mean": -1005.3848266601562, + "std": 1308.8258056640625, + "pct": { + "0.1": -4452.6277480541985, + "1": -3641.634707712471, + "5": -2937.4861003450947, + "25": -1881.7475544966392, + "50": -1170.6945714968547, + "75": -124.13671681902403, + "95": 1683.5400540223286, + "99": 3015.8060365193123, + "99.9": 3797.6599244161957 + } + }, + "f4b": { + "units": "A", + "source": "ptdata:F4B", + "description": "Shaping F-coil F4B current (bank B).", + "min": -5829.242194941551, + "max": 5787.149431930685, + "mean": 1124.2967529296875, + "std": 1519.5994873046875, + "pct": { + "0.1": -4083.976449898858, + "1": -3247.08251902718, + "5": -2270.942268479742, + "25": 376.8608226937906, + "50": 1392.450441038166, + "75": 2146.7001303629104, + "95": 3145.5476189867913, + "99": 3926.614817946318, + "99.9": 4582.551950710075 + } + }, + "f5b": { + "units": "A", + "source": "ptdata:F5B", + "description": "Shaping F-coil F5B current (bank B).", + "min": -5213.110339059254, + "max": 5388.213772287713, + "mean": 1443.536865234375, + "std": 1408.3306884765625, + "pct": { + "0.1": -4134.61747806435, + "1": -3056.873937432705, + "5": -1361.0988601293998, + "25": 675.1515533174199, + "50": 1572.802070225599, + "75": 2367.5452263604984, + "95": 3528.863240540377, + "99": 4411.454242162536, + "99.9": 4967.30642206674 + } + }, + "f6b": { + "units": "A", + "source": "ptdata:F6B", + "description": "Shaping F-coil F6B current (bank B).", + "min": -7604.653108484432, + "max": 7763.1261416792295, + "mean": -2463.248046875, + "std": 1836.4208984375, + "pct": { + "0.1": -6372.627428710043, + "1": -5251.4106280007745, + "5": -4318.157196234368, + "25": -3524.5849152058445, + "50": -2837.2759930056304, + "75": -2089.94465303326, + "95": 2871.6849973390945, + "99": 3948.010461650111, + "99.9": 4803.251616324593 + } + }, + "f7b": { + "units": "A", + "source": "ptdata:F7B", + "description": "Shaping F-coil F7B current (bank B).", + "min": -11380.254539563213, + "max": 9414.242772782009, + "mean": -2941.56005859375, + "std": 2510.1083984375, + "pct": { + "0.1": -9236.286164628174, + "1": -7962.01372128499, + "5": -6618.689743738845, + "25": -4397.68407591947, + "50": -3041.7944101983817, + "75": -2113.0768216001165, + "95": 2850.240503964187, + "99": 5238.131223534479, + "99.9": 6771.41582857779 + } + }, + "f8b": { + "units": "A", + "source": "ptdata:F8B", + "description": "Shaping F-coil F8B current (bank B).", + "min": -5834.457886045129, + "max": 5952.292180058913, + "mean": 1431.05615234375, + "std": 1718.2965087890625, + "pct": { + "0.1": -4377.886849186064, + "1": -3547.8568327724756, + "5": -2536.325388000092, + "25": 592.1441487378677, + "50": 1743.1741236182588, + "75": 2613.9050347435855, + "95": 3655.019608301406, + "99": 4295.252919476556, + "99.9": 5183.621783504976 + } + }, + "f9b": { + "units": "A", + "source": "ptdata:F9B", + "description": "Shaping F-coil F9B current (bank B).", + "min": -7298.33418485197, + "max": 8673.475372842513, + "mean": -214.02586364746094, + "std": 1388.83447265625, + "pct": { + "0.1": -4443.002941036773, + "1": -3335.961239603393, + "5": -2530.3434455144015, + "25": -1111.6205754278508, + "50": -212.41719832099042, + "75": 564.1401009862525, + "95": 2296.158459733251, + "99": 3401.023805016151, + "99.9": 4981.695296538042 + } + }, + "ecoila": { + "units": "A", + "source": "ptdata:ECOILA", + "description": "Ohmic E-coil bank A current.", + "min": -68526.67779690563, + "max": 65669.33446503483, + "mean": -6965.32666015625, + "std": 18940.9453125, + "pct": { + "0.1": -62521.0592220894, + "1": -53449.0677376177, + "5": -39610.65329064206, + "25": -19599.348704727538, + "50": -6887.604056684089, + "75": 6065.040591650557, + "95": 23926.96154448237, + "99": 33650.27142286909, + "99.9": 48164.54971213867 + } + }, + "ecoilb": { + "units": "A", + "source": "ptdata:ECOILB", + "description": "Ohmic E-coil bank B current.", + "min": -67880.78461590248, + "max": 67380.80764904841, + "mean": -6876.16455078125, + "std": 18723.662109375, + "pct": { + "0.1": -61839.528701402356, + "1": -52787.079189397904, + "5": -39153.2527665565, + "25": -19383.82435886666, + "50": -6768.996463787789, + "75": 6013.297288247475, + "95": 23686.641557508636, + "99": 33187.653018934754, + "99.9": 47362.43837391052 + } + }, + "gasa_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "description": "Calibrated gas injection flow, valve A.", + "min": -0.9805486760911233, + "max": 348.1779045740827, + "mean": 15.054444313049316, + "std": 26.369497299194336, + "pct": { + "0.1": -0.0181447514768128, + "1": 0.0006228885411054819, + "5": 0.0014589414841879034, + "25": 0.00852798057103854, + "50": 0.09974314587981326, + "75": 19.645558552678416, + "95": 71.02669389337856, + "99": 137.36341388263276, + "99.9": 211.79616738152396 + } + }, + "gasb_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "description": "Calibrated gas injection flow, valve B.", + "min": -0.5231055139632899, + "max": 317.69717326145866, + "mean": 1.386172890663147, + "std": 3.4090511798858643, + "pct": { + "0.1": 9.14047308575583e-06, + "1": 0.0007714573310613204, + "5": 0.002068321612864521, + "25": 0.009055124211873267, + "50": 0.07339015461169385, + "75": 1.9421402622606716, + "95": 1.9421402622606716, + "99": 23.663863921838843, + "99.9": 149.40068998150738 + } + }, + "gasc_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "description": "Calibrated gas injection flow, valve C.", + "min": -0.3965804467767108, + "max": 306.0269668007428, + "mean": 0.35034820437431335, + "std": 0.4470684826374054, + "pct": { + "0.1": 7.428448363699935e-05, + "1": 0.00026770734685732656, + "5": 0.0006667805693404416, + "25": 0.002788385500787083, + "50": 0.023577950502740697, + "75": 0.7508911827356307, + "95": 0.7508911827356307, + "99": 2.733332630282, + "99.9": 108.67323889612304 + } + }, + "gasd_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "description": "Calibrated gas injection flow, valve D.", + "min": -0.5287260135880842, + "max": 771.5043798529183, + "mean": 0.528103232383728, + "std": 0.654624342918396, + "pct": { + "0.1": 5.497087182604332e-05, + "1": 0.000175335120693898, + "5": 0.0005482846440516553, + "25": 0.003719433481388368, + "50": 0.08385269566973214, + "75": 1.0383906373403984, + "95": 1.0383906373403984, + "99": 4.359676988215197, + "99.9": 127.54440071212512 + } + }, + "gase_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "description": "Calibrated gas injection flow, valve E.", + "min": -0.2211384331710633, + "max": 672.8582070151267, + "mean": 0.27696067094802856, + "std": 0.17616958916187286, + "pct": { + "0.1": 0.00010156410138473793, + "1": 0.000223585566083373, + "5": 0.0005190716405260032, + "25": 0.011627604901727706, + "50": 0.3920832239686922, + "75": 0.3920832239686922, + "95": 0.3920832239686922, + "99": 0.3920832239686922, + "99.9": 29.75536079519976 + } + }, + "bt": { + "units": "T", + "source": "ptdata:bt", + "description": "Vacuum toroidal magnetic field (signed).", + "min": -2.2353815075115375, + "max": 2.25186423641397, + "mean": -0.971906840801239, + "std": 1.6484158039093018, + "pct": { + "0.1": -2.2151064134142304, + "1": -2.1819873443702726, + "5": -2.136304350652244, + "25": -2.0446028795017246, + "50": -1.8984274308309796, + "75": -1.0260122281948352, + "95": 2.053318112027725, + "99": 2.10945640328767, + "99.9": 2.1819705410137904 + } + } + } +} diff --git a/s5/fuse29_seq.onnx b/s5/fuse29_seq.onnx new file mode 100644 index 0000000000000000000000000000000000000000..321dff6f6cdec5a5f93397bfcc109ce78bfd0f62 --- /dev/null +++ b/s5/fuse29_seq.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bee461499d85d1cf7ce5b4f5f56ab1bf13b55066737c08147e860211b0091ff3 +size 45464382 diff --git a/s5/fuse29_step.onnx b/s5/fuse29_step.onnx new file mode 100644 index 0000000000000000000000000000000000000000..6ed45aa7ed5cde7a55a77bee14fcf22ae985dac7 --- /dev/null +++ b/s5/fuse29_step.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e10c13fc85dd992fafbaddc8b3dd01d11aabaf757e3e125329a699d298a6a11 +size 45081271 diff --git a/s5/model_config.json b/s5/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..3a0cd208e21b7cfccce744f26f997ed535b33e8c --- /dev/null +++ b/s5/model_config.json @@ -0,0 +1,268 @@ +{ + "schema_version": 1, + "model": "fuse29", + "seed": 5, + "description": "29-input Mamba-2 pedestal predictor for DIII-D. Strictly causal, 20 Hz, nine heads at rho_tor = 0.85.", + "architecture": { + "family": "Mamba-2 (structured state-space duality)", + "d_model": 512, + "n_layers": 6, + "d_state": 128, + "d_conv": 4, + "expand": 2, + "headdim": 128, + "nheads": 8, + "ngroups": 2, + "chunk_size": 100, + "d_inner": 1024, + "conv_dim": 1536, + "n_params": 11254425 + }, + "cadence": { + "hz": 20, + "period_ms": 50.0, + "rho_tor": 0.85 + }, + "inputs": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "n": 29, + "units": { + "pinj": "MW", + "tinj": "N*m", + "ech_total": "MW", + "f1a": "A", + "f2a": "A", + "f3a": "A", + "f4a": "A", + "f5a": "A", + "f6a": "A", + "f7a": "A", + "f8a": "A", + "f9a": "A", + "f1b": "A", + "f2b": "A", + "f3b": "A", + "f4b": "A", + "f5b": "A", + "f6b": "A", + "f7b": "A", + "f8b": "A", + "f9b": "A", + "ecoila": "A", + "ecoilb": "A", + "gasa_cal": "Torr*L/s", + "gasb_cal": "Torr*L/s", + "gasc_cal": "Torr*L/s", + "gasd_cal": "Torr*L/s", + "gase_cal": "Torr*L/s", + "bt": "T" + }, + "sources": { + "pinj": "ptdata:bmspinj", + "tinj": "ptdata:bmstinj", + "ech_total": "ptdata:ECHPWR", + "f1a": "ptdata:F1A", + "f2a": "ptdata:F2A", + "f3a": "ptdata:F3A", + "f4a": "ptdata:F4A", + "f5a": "ptdata:F5A", + "f6a": "ptdata:F6A", + "f7a": "ptdata:F7A", + "f8a": "ptdata:F8A", + "f9a": "ptdata:F9A", + "f1b": "ptdata:F1B", + "f2b": "ptdata:F2B", + "f3b": "ptdata:F3B", + "f4b": "ptdata:F4B", + "f5b": "ptdata:F5B", + "f6b": "ptdata:F6B", + "f7b": "ptdata:F7B", + "f8b": "ptdata:F8B", + "f9b": "ptdata:F9B", + "ecoila": "ptdata:ECOILA", + "ecoilb": "ptdata:ECOILB", + "gasa_cal": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "gasb_cal": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "gasc_cal": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "gasd_cal": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "gase_cal": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "bt": "ptdata:bt" + }, + "descriptions": { + "pinj": "Neutral beam injected power, all sources.", + "tinj": "Neutral beam injected torque, all sources.", + "ech_total": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "f1a": "Shaping F-coil F1A current (bank A).", + "f2a": "Shaping F-coil F2A current (bank A).", + "f3a": "Shaping F-coil F3A current (bank A).", + "f4a": "Shaping F-coil F4A current (bank A).", + "f5a": "Shaping F-coil F5A current (bank A).", + "f6a": "Shaping F-coil F6A current (bank A).", + "f7a": "Shaping F-coil F7A current (bank A).", + "f8a": "Shaping F-coil F8A current (bank A).", + "f9a": "Shaping F-coil F9A current (bank A).", + "f1b": "Shaping F-coil F1B current (bank B).", + "f2b": "Shaping F-coil F2B current (bank B).", + "f3b": "Shaping F-coil F3B current (bank B).", + "f4b": "Shaping F-coil F4B current (bank B).", + "f5b": "Shaping F-coil F5B current (bank B).", + "f6b": "Shaping F-coil F6B current (bank B).", + "f7b": "Shaping F-coil F7B current (bank B).", + "f8b": "Shaping F-coil F8B current (bank B).", + "f9b": "Shaping F-coil F9B current (bank B).", + "ecoila": "Ohmic E-coil bank A current.", + "ecoilb": "Ohmic E-coil bank B current.", + "gasa_cal": "Calibrated gas injection flow, valve A.", + "gasb_cal": "Calibrated gas injection flow, valve B.", + "gasc_cal": "Calibrated gas injection flow, valve C.", + "gasd_cal": "Calibrated gas injection flow, valve D.", + "gase_cal": "Calibrated gas injection flow, valve E.", + "bt": "Vacuum toroidal magnetic field (signed)." + }, + "space": "raw physical units; the graph applies the z-score", + "note": "Check your units against actuator_ranges.json before trusting any output. A unit error produces confident nonsense rather than an exception." + }, + "outputs": { + "names": [ + "ne", + "te_ped", + "ti_ped", + "t_rot_ped", + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc", + "hmode" + ], + "n": 9, + "units": { + "ne": "1e19 m^-3", + "te_ped": "keV", + "ti_ped": "keV", + "t_rot_ped": "krad/s", + "neped_prmtan": "1e19 m^-3", + "teped_prmtan": "keV", + "rho_sym": "rho_tor (dimensionless)", + "ne_top_loc": "rho_tor (dimensionless)", + "hmode": "probability in [0, 1]" + }, + "note": "Physical units. hmode is a probability in [0, 1]; the graph applies the sigmoid.", + "hmode_gated": { + "heads": [ + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc" + ], + "indices": [ + 4, + 5, + 6, + 7 + ], + "threshold": 0.5, + "note": "These four heads were trained only on H-mode rows and are undefined otherwise. The graph does NOT gate them; the consumer must, using the model's own hmode output. See docs/GATING.md." + } + }, + "graphs": { + "fuse29_step.onnx": { + "purpose": "real-time, one 50 ms tick per call", + "inputs": { + "actuators": [ + "batch", + 29 + ], + "conv_state": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "outputs": { + "predictions": [ + "batch", + 9 + ], + "conv_state_out": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state_out": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "initial_state": "all zeros at the start of a shot", + "max_shot_length": "unbounded" + }, + "fuse29_seq.onnx": { + "purpose": "offline scoring of a whole shot", + "inputs": { + "actuators": [ + "batch", + 256, + 29 + ] + }, + "outputs": { + "predictions": [ + "batch", + 256, + 9 + ] + }, + "seq_len": 256, + "note": "Sequence length is FIXED. Right-pad shorter shots with zeros and read the first T outputs; the model is strictly causal so this is exact. For longer shots use the step graph or re-export with --seq-len." + } + }, + "dtype": "float32", + "onnx_opset": 17, + "training": { + "epoch": 21, + "val_loss": 1.1122196558862925, + "note": "See docs/TRAINING.md for the full recipe." + } +} diff --git a/s5/norms.json b/s5/norms.json new file mode 100644 index 0000000000000000000000000000000000000000..98c8c06209fd050ed78c21fa5b30afd95a71c171 --- /dev/null +++ b/s5/norms.json @@ -0,0 +1,292 @@ +{ + "schema_version": 2, + "note": "Statistics are baked into the shipped ONNX graphs. This file is for inspection and for reproducing the transform outside the graph; it is not required at inference time.", + "actuator_space": "physical", + "std_floor": 1e-06, + "clip_sigma": 20.0, + "provenance": { + "split": "train", + "n_shots": 32731, + "rho_index": 85, + "source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85, random stratified split (split_index.json)", + "note": "Recomputed on the NEW random train split. The source shards carried z-scores from the OLD chronological train split, whose shots overlap our test set. Actuator statistics are winsorised so a corrupted sample cannot set a channel's divisor.", + "inflated_channels": [ + "pinj", + "gasc_cal", + "gasd_cal", + "gase_cal" + ], + "actuator_estimator": "winsorised to p1..p99", + "actuator_space": "physical", + "composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "composition": "z = (x_phys - (m1 + s1*m2)) / (s1*s2), where (m1, s1) is the upstream FPE z-score and (m2, s2) is this model's re-scale onto its own training split" + }, + "actuators": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "mean": [ + 3.838883638381958, + 2.2043209075927734, + 2.6981112957000732, + -1382.3704833984375, + -1229.876708984375, + -592.7352294921875, + 1098.1622314453125, + 1173.57958984375, + -2493.411865234375, + -2367.570556640625, + 996.0214233398438, + -535.8018798828125, + -1373.1888427734375, + -1218.50048828125, + -1005.3848266601562, + 1124.2967529296875, + 1443.536865234375, + -2463.248046875, + -2941.56005859375, + 1431.05615234375, + -214.02586364746094, + -6965.32666015625, + -6876.16455078125, + 15.054444313049316, + 1.386172890663147, + 0.35034820437431335, + 0.528103232383728, + 0.27696067094802856, + -0.971906840801239 + ], + "std": [ + 3.0613932609558105, + 2.11222505569458, + 6.685519218444824, + 1349.629638671875, + 1248.3497314453125, + 1185.706298828125, + 1368.95458984375, + 1352.103759765625, + 1867.8076171875, + 1999.19970703125, + 1498.948974609375, + 1258.01171875, + 1367.82275390625, + 1316.67724609375, + 1308.8258056640625, + 1519.5994873046875, + 1408.3306884765625, + 1836.4208984375, + 2510.1083984375, + 1718.2965087890625, + 1388.83447265625, + 18940.9453125, + 18723.662109375, + 26.369497299194336, + 3.4090511798858643, + 0.4470684826374054, + 0.654624342918396, + 0.17616958916187286, + 1.6484158039093018 + ], + "transform": "z = clip((x - mean) / std, -clip_sigma, +clip_sigma), applied inside the graph" + }, + "targets": { + "ne": { + "mean": 2.7511744499206543, + "std": 1.654153823852539 + }, + "te_ped": { + "mean": 0.5915626287460327, + "std": 0.43467429280281067 + }, + "ti_ped": { + "mean": 1.016850233078003, + "std": 0.681096076965332 + }, + "t_rot_ped": { + "mean": 21.244613647460938, + "std": 16.59148406982422 + }, + "neped_prmtan": { + "mean": 2.7231285572052, + "std": 1.7005536556243896 + }, + "teped_prmtan": { + "mean": 0.46375223994255066, + "std": 0.36919456720352173 + }, + "rho_sym": { + "mean": 0.9757616519927979, + "std": 0.04329206794500351 + }, + "ne_top_loc": { + "mean": 0.9261865019798279, + "std": 0.049897171556949615 + } + }, + "hmode": { + "transform": "sigmoid", + "note": "hmode is a logit in the trunk; the graph applies the sigmoid." + }, + "stages": { + "note": "The composed actuator statistics above are the product of these two. Shown for traceability; use the composed values.", + "stage1_physical_to_fpe_zscore": { + "mean": [ + 2.8111997039100878, + 2.154143940948575, + 2.159654935239209, + -1444.0438445123289, + -1315.1185221229061, + -639.741760304047, + 1172.4978680515835, + 1222.4970107268077, + -2488.8410961768263, + -2491.3739557685253, + 1050.107386405324, + -578.9736547563273, + -1421.0817159358041, + -1285.3967398730092, + -1061.0290851406676, + 1186.4795970820587, + 1460.6822372728345, + -2452.093120847959, + -3071.3132492215186, + 1531.3304960724108, + -262.6728625067526, + -6887.604056684089, + -6768.996463787789, + 14.89178144369171, + 1.9421402622606716, + 0.7508911827356307, + 1.0383906373403984, + 0.3920832239686922, + -1.0310375752078498 + ], + "std": [ + 194.08418888726106, + 2.3684465859740262, + 5.948083564785035, + 1267.4907621702682, + 1217.4478106828162, + 1249.3915272640536, + 1345.3871181128568, + 1359.1934832307923, + 1887.1891497052302, + 1888.1014577442652, + 1559.9875106371376, + 1287.2118470203372, + 1271.813282654729, + 1259.8644805335082, + 1361.9306367877398, + 1521.172083160852, + 1393.2120473032558, + 1856.723912629122, + 2432.8530409799628, + 1705.6959050005082, + 1421.8036451037203, + 19092.148992270486, + 18858.28389193975, + 27.289184462156058, + 11.092415079529571, + 9.017289768908354, + 12.055982101097918, + 6.498888909025979, + 1.599000778986496 + ] + }, + "stage2_fpe_zscore_to_model": { + "mean": [ + 0.0052950419485569, + 0.02118559367954731, + 0.0905260294675827, + 0.04865782707929611, + 0.0700167864561081, + 0.03762352466583252, + -0.05525219440460205, + -0.03599006310105324, + -0.002421961398795247, + 0.06557027250528336, + -0.03467077016830444, + 0.03353898227214813, + 0.03765711933374405, + 0.05309795215725899, + 0.040856875479221344, + -0.04087827727198601, + -0.012306398712098598, + -0.006007813848555088, + 0.05333370715379715, + -0.05878793075680733, + 0.03421499580144882, + -0.004070908762514591, + -0.00568280229344964, + 0.005960696842521429, + -0.050121404230594635, + -0.04441944137215614, + -0.042326491326093674, + -0.017714189365506172, + 0.036979787051677704 + ], + "std": [ + 0.015773532912135124, + 0.8918187022209167, + 1.1239787340164185, + 1.0648043155670166, + 1.0253825187683105, + 0.9490270018577576, + 1.0175172090530396, + 0.994783878326416, + 0.9897299408912659, + 1.0588412284851074, + 0.9608724117279053, + 0.9773152470588684, + 1.0754902362823486, + 1.04509437084198, + 0.9610077142715454, + 0.9989661574363708, + 1.0108516216278076, + 0.9890651702880859, + 1.0317550897598267, + 1.007387399673462, + 0.9768117070198059, + 0.9920803308486938, + 0.9928614497184753, + 0.9662984609603882, + 0.30733174085617065, + 0.04957903176546097, + 0.05429871752858162, + 0.02710764855146408, + 1.030903697013855 + ] + } + } +} diff --git a/s5/provenance.json b/s5/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..bfe8f23582c786e1724b96026b6051923cc1bd0d --- /dev/null +++ b/s5/provenance.json @@ -0,0 +1,32 @@ +{ + "schema_version": 1, + "exported_utc": "2026-09-03T00:46:35.316400+00:00", + "seed": 5, + "source_checkpoint": "/flare/fusiondl_aesp/fuse_bd_model/fuse20/runs/fuse29r_s5/best_model.pt", + "source_checkpoint_sha256": "d01cae015ed05e7e2b97df02796afb8c5aaf4ee36573ed534a2ed9dd9a16c275", + "norms_source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json", + "norms_actuator_space": "physical", + "norms_composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "onnx_opset": 17, + "exporter": "torch.onnx.export (TorchScript, dynamo=False)", + "versions": { + "torch": "2.10.0a0+git449b176", + "python": "3.12.12", + "platform": "Linux-5.14.21-150400.24.235-default-x86_64-with-glibc2.31", + "onnx": "1.22.0", + "onnxruntime": "1.29.0" + }, + "artifacts": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "1e10c13fc85dd992fafbaddc8b3dd01d11aabaf757e3e125329a699d298a6a11" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "bee461499d85d1cf7ce5b4f5f56ab1bf13b55066737c08147e860211b0091ff3" + } + } +} diff --git a/s6/README.md b/s6/README.md new file mode 100644 index 0000000000000000000000000000000000000000..77f692cc7b56786d31ec20cdf57798f0753d57e5 --- /dev/null +++ b/s6/README.md @@ -0,0 +1,56 @@ +--- +license: mit +library_name: onnx +tags: + - onnx + - fusion + - plasma-physics + - tokamak + - diii-d + - mamba +--- + +# fuse29 — seed 6 + +This is seed 6, one of eight independently trained runs. Seed 0 is the champion and the default; this one exists so you can measure spread across training runs. Unless you are doing that, you want seed 0. + +29-input Mamba-2 pedestal predictor for DIII-D. Raw physical units in, +physical units out. See the [root model card](https://huggingface.co/SCS-Lab/FUSE29-Pedestal-model) +for the full description, I/O contract, accuracy and limitations. + +| | | +|---|---| +| Seed | 6 | +| Parameters | 11,254,425 | +| Best validation loss | 1.1162 | +| Sequence graph length | 256 ticks | +| ONNX opset | 17 | +| Exported | 2026-09-03T00:46:38.050137+00:00 | +| Source checkpoint SHA-256 | `97dfda0fd4b66942…` | + +## Load + +```python +from fuse29.runtime import Fuse29Predictor + +predictor = Fuse29Predictor.from_pretrained("SCS-Lab/FUSE29-Pedestal-model", seed=6) +``` + +## Files + +| File | | +|---|---| +| `fuse29_step.onnx` | one 50 ms tick, carries state, no length limit | +| `fuse29_seq.onnx` | whole shot at a fixed 256 ticks | +| `model_config.json` | I/O contract: names, order, units, sources, shapes | +| `norms.json` | the statistics baked into the graphs | +| `actuator_ranges.json` | training-split distribution, for checking your units | +| `provenance.json` | source checkpoint hash, library versions, artefact hashes | + +## Before you use it + +- Four heads (`neped_prmtan`, `teped_prmtan`, `rho_sym`, `ne_top_loc`) are + **only valid in H-mode** and the graph does not gate them. Gate on the + model's own `hmode` output. +- `pinj` is in **MW**, not W. Run `predictor.check_units(shot)` once. +- Output column order is not alphabetical. See `model_config.json`. diff --git a/s6/actuator_ranges.json b/s6/actuator_ranges.json new file mode 100644 index 0000000000000000000000000000000000000000..08d19f4e80f49e6bbd18c40674b06946a02cc61a --- /dev/null +++ b/s6/actuator_ranges.json @@ -0,0 +1,600 @@ +{ + "schema_version": 1, + "note": "Physical-units distribution of each actuator over the training split. Use it to check that your signals are in the units the graph expects; a unit error is the one preprocessing mistake that produces confident nonsense rather than an exception.", + "split": "train", + "n_shots": 32731, + "n_ticks": 3020926, + "percentiles": [ + 0.1, + 1, + 5, + 25, + 50, + 75, + 95, + 99, + 99.9 + ], + "channels": { + "pinj": { + "units": "MW", + "source": "ptdata:bmspinj", + "description": "Neutral beam injected power, all sources.", + "min": -46005.02701919088, + "max": 17.512712760455507, + "mean": 3.838883638381958, + "std": 3.0613932609558105, + "pct": { + "0.1": -0.004132416388869853, + "1": 4.112187479421436e-09, + "5": 4.112187479421436e-09, + "25": 1.311169336894574, + "50": 3.18466408866965, + "75": 5.748764762873332, + "95": 9.841882532311711, + "99": 12.212702351352696, + "99.9": 14.791924355083399 + } + }, + "tinj": { + "units": "N*m", + "source": "ptdata:bmstinj", + "description": "Neutral beam injected torque, all sources.", + "min": -56.644382966354534, + "max": 129.9833380295058, + "mean": 2.2043209075927734, + "std": 2.11222505569458, + "pct": { + "0.1": -2.0636791725994676, + "1": -0.5384317586520496, + "5": -1.6338495756329507e-07, + "25": 0.4319133403840452, + "50": 1.963846077087278, + "75": 3.1821234334199193, + "95": 6.641525317445799, + "99": 8.941231792062355, + "99.9": 11.156712776956862 + } + }, + "ech_total": { + "units": "MW", + "source": "ptdata:ECHPWR", + "description": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "min": -19.31181996542309, + "max": 40.286455582885246, + "mean": 2.6981112957000732, + "std": 6.685519218444824, + "pct": { + "0.1": -1.0663586061709935, + "1": -0.09982622583332723, + "5": -0.020836448436920674, + "25": -3.2566890961760464e-08, + "50": -3.2566890961760464e-08, + "75": 1.1717011943616973, + "95": 21.558252060431304, + "99": 30.476182922859127, + "99.9": 37.09168917133024 + } + }, + "f1a": { + "units": "A", + "source": "ptdata:F1A", + "description": "Shaping F-coil F1A current (bank A).", + "min": -5776.925892871883, + "max": 5794.3504737288395, + "mean": -1382.3704833984375, + "std": 1349.629638671875, + "pct": { + "0.1": -4852.691808601986, + "1": -4131.456225748339, + "5": -3401.8604035239678, + "25": -2236.4754469921672, + "50": -1501.5458201268116, + "75": -660.4245966463927, + "95": 1294.4315819071094, + "99": 3103.250955923345, + "99.9": 4467.289606367005 + } + }, + "f2a": { + "units": "A", + "source": "ptdata:F2A", + "description": "Shaping F-coil F2A current (bank A).", + "min": -5716.347659616551, + "max": 5702.840977614059, + "mean": -1229.876708984375, + "std": 1248.3497314453125, + "pct": { + "0.1": -4093.397230708888, + "1": -3297.8668360449756, + "5": -2712.522533155646, + "25": -2004.455454331444, + "50": -1443.842241803098, + "75": -854.5004209979342, + "95": 1825.579117167513, + "99": 3097.0902901803724, + "99.9": 3899.548655232026 + } + }, + "f3a": { + "units": "A", + "source": "ptdata:F3A", + "description": "Shaping F-coil F3A current (bank A).", + "min": -5498.272347966228, + "max": 5321.719922394657, + "mean": -592.7352294921875, + "std": 1185.706298828125, + "pct": { + "0.1": -4140.690909683277, + "1": -3539.2136012211317, + "5": -2813.2888996278725, + "25": -1377.7435033975407, + "50": -152.16189816331342, + "75": 2.4453898354848604, + "95": 1203.107532773337, + "99": 2898.3184344684487, + "99.9": 3780.0556837479485 + } + }, + "f4a": { + "units": "A", + "source": "ptdata:F4A", + "description": "Shaping F-coil F4A current (bank A).", + "min": -5876.373800845117, + "max": 5855.700219305917, + "mean": 1098.1622314453125, + "std": 1368.95458984375, + "pct": { + "0.1": -4331.218505807293, + "1": -3344.4526378786877, + "5": -1858.4157962413597, + "25": 395.84891116184133, + "50": 1143.436262581068, + "75": 1990.2677717095535, + "95": 3141.5448401142426, + "99": 3756.430079500399, + "99.9": 4525.754910416766 + } + }, + "f5a": { + "units": "A", + "source": "ptdata:F5A", + "description": "Shaping F-coil F5A current (bank A).", + "min": -5178.8539079385355, + "max": 5353.141466672798, + "mean": 1173.57958984375, + "std": 1352.103759765625, + "pct": { + "0.1": -4592.7059148331355, + "1": -3597.7201189044818, + "5": -1551.4942446467403, + "25": 543.836095032849, + "50": 1273.969119983141, + "75": 2051.0443148459794, + "95": 3019.669622905384, + "99": 3875.454685744494, + "99.9": 4738.506855960392 + } + }, + "f6a": { + "units": "A", + "source": "ptdata:F6A", + "description": "Shaping F-coil F6A current (bank A).", + "min": -7929.903731492232, + "max": 5741.056818467809, + "mean": -2493.411865234375, + "std": 1867.8076171875, + "pct": { + "0.1": -6125.90268588119, + "1": -4963.398523516425, + "5": -4319.477588996284, + "25": -3574.8234234024885, + "50": -2898.635802832382, + "75": -2143.0930801744807, + "95": 2999.75903843203, + "99": 4137.6543157735705, + "99.9": 4783.375582166487 + } + }, + "f7a": { + "units": "A", + "source": "ptdata:F7A", + "description": "Shaping F-coil F7A current (bank A).", + "min": -9825.736080045011, + "max": 8678.484606762057, + "mean": -2367.570556640625, + "std": 1999.19970703125, + "pct": { + "0.1": -7676.219824168618, + "1": -6127.379912259545, + "5": -4909.893927511103, + "25": -3430.1309476786882, + "50": -2697.460342263373, + "75": -1913.0579478721388, + "95": 2723.164038733837, + "99": 3948.221013655396, + "99.9": 5316.086800760559 + } + }, + "f8a": { + "units": "A", + "source": "ptdata:F8A", + "description": "Shaping F-coil F8A current (bank A).", + "min": -5378.835169240788, + "max": 5880.767402237174, + "mean": 996.0214233398438, + "std": 1498.948974609375, + "pct": { + "0.1": -4229.744640827867, + "1": -3363.368412210415, + "5": -1922.2114690963926, + "25": 60.761390529545906, + "50": 1153.9241798399726, + "75": 1951.1572686642544, + "95": 3318.078493605748, + "99": 3973.7764489149104, + "99.9": 4670.296725684707 + } + }, + "f9a": { + "units": "A", + "source": "ptdata:F9A", + "description": "Shaping F-coil F9A current (bank A).", + "min": -7206.032812499594, + "max": 8700.684616308497, + "mean": -535.8018798828125, + "std": 1258.01171875, + "pct": { + "0.1": -4739.927394914494, + "1": -3344.557163847978, + "5": -2567.420669960383, + "25": -1538.6304412830955, + "50": -578.9736547563273, + "75": 353.08467764596537, + "95": 1558.2607279613098, + "99": 2657.691791383836, + "99.9": 4334.930796170508 + } + }, + "f1b": { + "units": "A", + "source": "ptdata:F1B", + "description": "Shaping F-coil F1B current (bank B).", + "min": -5921.943154546981, + "max": 5407.326196618229, + "mean": -1373.1888427734375, + "std": 1367.82275390625, + "pct": { + "0.1": -5179.567735964654, + "1": -4339.478258925401, + "5": -3463.431883510691, + "25": -2205.922070942479, + "50": -1459.5306304510002, + "75": -750.1948036110768, + "95": 1428.796834935177, + "99": 3233.0438718527407, + "99.9": 4240.724502122051 + } + }, + "f2b": { + "units": "A", + "source": "ptdata:F2B", + "description": "Shaping F-coil F2B current (bank B).", + "min": -5788.286812358208, + "max": 5428.562849130928, + "mean": -1218.50048828125, + "std": 1316.67724609375, + "pct": { + "0.1": -4785.998935671587, + "1": -3520.521383204173, + "5": -2855.1671089762676, + "25": -1969.483606794242, + "50": -1447.1879016413761, + "75": -866.6265611311096, + "95": 2049.217650390811, + "99": 3312.4349928765846, + "99.9": 4011.5142868858347 + } + }, + "f3b": { + "units": "A", + "source": "ptdata:F3B", + "description": "Shaping F-coil F3B current (bank B).", + "min": -5503.943071765381, + "max": 4849.177948074737, + "mean": -1005.3848266601562, + "std": 1308.8258056640625, + "pct": { + "0.1": -4452.6277480541985, + "1": -3641.634707712471, + "5": -2937.4861003450947, + "25": -1881.7475544966392, + "50": -1170.6945714968547, + "75": -124.13671681902403, + "95": 1683.5400540223286, + "99": 3015.8060365193123, + "99.9": 3797.6599244161957 + } + }, + "f4b": { + "units": "A", + "source": "ptdata:F4B", + "description": "Shaping F-coil F4B current (bank B).", + "min": -5829.242194941551, + "max": 5787.149431930685, + "mean": 1124.2967529296875, + "std": 1519.5994873046875, + "pct": { + "0.1": -4083.976449898858, + "1": -3247.08251902718, + "5": -2270.942268479742, + "25": 376.8608226937906, + "50": 1392.450441038166, + "75": 2146.7001303629104, + "95": 3145.5476189867913, + "99": 3926.614817946318, + "99.9": 4582.551950710075 + } + }, + "f5b": { + "units": "A", + "source": "ptdata:F5B", + "description": "Shaping F-coil F5B current (bank B).", + "min": -5213.110339059254, + "max": 5388.213772287713, + "mean": 1443.536865234375, + "std": 1408.3306884765625, + "pct": { + "0.1": -4134.61747806435, + "1": -3056.873937432705, + "5": -1361.0988601293998, + "25": 675.1515533174199, + "50": 1572.802070225599, + "75": 2367.5452263604984, + "95": 3528.863240540377, + "99": 4411.454242162536, + "99.9": 4967.30642206674 + } + }, + "f6b": { + "units": "A", + "source": "ptdata:F6B", + "description": "Shaping F-coil F6B current (bank B).", + "min": -7604.653108484432, + "max": 7763.1261416792295, + "mean": -2463.248046875, + "std": 1836.4208984375, + "pct": { + "0.1": -6372.627428710043, + "1": -5251.4106280007745, + "5": -4318.157196234368, + "25": -3524.5849152058445, + "50": -2837.2759930056304, + "75": -2089.94465303326, + "95": 2871.6849973390945, + "99": 3948.010461650111, + "99.9": 4803.251616324593 + } + }, + "f7b": { + "units": "A", + "source": "ptdata:F7B", + "description": "Shaping F-coil F7B current (bank B).", + "min": -11380.254539563213, + "max": 9414.242772782009, + "mean": -2941.56005859375, + "std": 2510.1083984375, + "pct": { + "0.1": -9236.286164628174, + "1": -7962.01372128499, + "5": -6618.689743738845, + "25": -4397.68407591947, + "50": -3041.7944101983817, + "75": -2113.0768216001165, + "95": 2850.240503964187, + "99": 5238.131223534479, + "99.9": 6771.41582857779 + } + }, + "f8b": { + "units": "A", + "source": "ptdata:F8B", + "description": "Shaping F-coil F8B current (bank B).", + "min": -5834.457886045129, + "max": 5952.292180058913, + "mean": 1431.05615234375, + "std": 1718.2965087890625, + "pct": { + "0.1": -4377.886849186064, + "1": -3547.8568327724756, + "5": -2536.325388000092, + "25": 592.1441487378677, + "50": 1743.1741236182588, + "75": 2613.9050347435855, + "95": 3655.019608301406, + "99": 4295.252919476556, + "99.9": 5183.621783504976 + } + }, + "f9b": { + "units": "A", + "source": "ptdata:F9B", + "description": "Shaping F-coil F9B current (bank B).", + "min": -7298.33418485197, + "max": 8673.475372842513, + "mean": -214.02586364746094, + "std": 1388.83447265625, + "pct": { + "0.1": -4443.002941036773, + "1": -3335.961239603393, + "5": -2530.3434455144015, + "25": -1111.6205754278508, + "50": -212.41719832099042, + "75": 564.1401009862525, + "95": 2296.158459733251, + "99": 3401.023805016151, + "99.9": 4981.695296538042 + } + }, + "ecoila": { + "units": "A", + "source": "ptdata:ECOILA", + "description": "Ohmic E-coil bank A current.", + "min": -68526.67779690563, + "max": 65669.33446503483, + "mean": -6965.32666015625, + "std": 18940.9453125, + "pct": { + "0.1": -62521.0592220894, + "1": -53449.0677376177, + "5": -39610.65329064206, + "25": -19599.348704727538, + "50": -6887.604056684089, + "75": 6065.040591650557, + "95": 23926.96154448237, + "99": 33650.27142286909, + "99.9": 48164.54971213867 + } + }, + "ecoilb": { + "units": "A", + "source": "ptdata:ECOILB", + "description": "Ohmic E-coil bank B current.", + "min": -67880.78461590248, + "max": 67380.80764904841, + "mean": -6876.16455078125, + "std": 18723.662109375, + "pct": { + "0.1": -61839.528701402356, + "1": -52787.079189397904, + "5": -39153.2527665565, + "25": -19383.82435886666, + "50": -6768.996463787789, + "75": 6013.297288247475, + "95": 23686.641557508636, + "99": 33187.653018934754, + "99.9": 47362.43837391052 + } + }, + "gasa_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "description": "Calibrated gas injection flow, valve A.", + "min": -0.9805486760911233, + "max": 348.1779045740827, + "mean": 15.054444313049316, + "std": 26.369497299194336, + "pct": { + "0.1": -0.0181447514768128, + "1": 0.0006228885411054819, + "5": 0.0014589414841879034, + "25": 0.00852798057103854, + "50": 0.09974314587981326, + "75": 19.645558552678416, + "95": 71.02669389337856, + "99": 137.36341388263276, + "99.9": 211.79616738152396 + } + }, + "gasb_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "description": "Calibrated gas injection flow, valve B.", + "min": -0.5231055139632899, + "max": 317.69717326145866, + "mean": 1.386172890663147, + "std": 3.4090511798858643, + "pct": { + "0.1": 9.14047308575583e-06, + "1": 0.0007714573310613204, + "5": 0.002068321612864521, + "25": 0.009055124211873267, + "50": 0.07339015461169385, + "75": 1.9421402622606716, + "95": 1.9421402622606716, + "99": 23.663863921838843, + "99.9": 149.40068998150738 + } + }, + "gasc_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "description": "Calibrated gas injection flow, valve C.", + "min": -0.3965804467767108, + "max": 306.0269668007428, + "mean": 0.35034820437431335, + "std": 0.4470684826374054, + "pct": { + "0.1": 7.428448363699935e-05, + "1": 0.00026770734685732656, + "5": 0.0006667805693404416, + "25": 0.002788385500787083, + "50": 0.023577950502740697, + "75": 0.7508911827356307, + "95": 0.7508911827356307, + "99": 2.733332630282, + "99.9": 108.67323889612304 + } + }, + "gasd_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "description": "Calibrated gas injection flow, valve D.", + "min": -0.5287260135880842, + "max": 771.5043798529183, + "mean": 0.528103232383728, + "std": 0.654624342918396, + "pct": { + "0.1": 5.497087182604332e-05, + "1": 0.000175335120693898, + "5": 0.0005482846440516553, + "25": 0.003719433481388368, + "50": 0.08385269566973214, + "75": 1.0383906373403984, + "95": 1.0383906373403984, + "99": 4.359676988215197, + "99.9": 127.54440071212512 + } + }, + "gase_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "description": "Calibrated gas injection flow, valve E.", + "min": -0.2211384331710633, + "max": 672.8582070151267, + "mean": 0.27696067094802856, + "std": 0.17616958916187286, + "pct": { + "0.1": 0.00010156410138473793, + "1": 0.000223585566083373, + "5": 0.0005190716405260032, + "25": 0.011627604901727706, + "50": 0.3920832239686922, + "75": 0.3920832239686922, + "95": 0.3920832239686922, + "99": 0.3920832239686922, + "99.9": 29.75536079519976 + } + }, + "bt": { + "units": "T", + "source": "ptdata:bt", + "description": "Vacuum toroidal magnetic field (signed).", + "min": -2.2353815075115375, + "max": 2.25186423641397, + "mean": -0.971906840801239, + "std": 1.6484158039093018, + "pct": { + "0.1": -2.2151064134142304, + "1": -2.1819873443702726, + "5": -2.136304350652244, + "25": -2.0446028795017246, + "50": -1.8984274308309796, + "75": -1.0260122281948352, + "95": 2.053318112027725, + "99": 2.10945640328767, + "99.9": 2.1819705410137904 + } + } + } +} diff --git a/s6/fuse29_seq.onnx b/s6/fuse29_seq.onnx new file mode 100644 index 0000000000000000000000000000000000000000..6ddb6dc3dcadca79ac8f6d59afd304b0b059a9f4 --- /dev/null +++ b/s6/fuse29_seq.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca3570ae8e579c638d9195f6f7e3c4634bc61425cc51c7998a53818cb8c18ddb +size 45464382 diff --git a/s6/fuse29_step.onnx b/s6/fuse29_step.onnx new file mode 100644 index 0000000000000000000000000000000000000000..297761d69ebf55257e4df88e20afe9a2abfab646 --- /dev/null +++ b/s6/fuse29_step.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36b55e194e705e0a1d1087c1164e4f72f2507784b1210a0ce2f94fa151db04fa +size 45081271 diff --git a/s6/model_config.json b/s6/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..79981ff09a62914e6f784a6ff8ec00adcfbe0307 --- /dev/null +++ b/s6/model_config.json @@ -0,0 +1,268 @@ +{ + "schema_version": 1, + "model": "fuse29", + "seed": 6, + "description": "29-input Mamba-2 pedestal predictor for DIII-D. Strictly causal, 20 Hz, nine heads at rho_tor = 0.85.", + "architecture": { + "family": "Mamba-2 (structured state-space duality)", + "d_model": 512, + "n_layers": 6, + "d_state": 128, + "d_conv": 4, + "expand": 2, + "headdim": 128, + "nheads": 8, + "ngroups": 2, + "chunk_size": 100, + "d_inner": 1024, + "conv_dim": 1536, + "n_params": 11254425 + }, + "cadence": { + "hz": 20, + "period_ms": 50.0, + "rho_tor": 0.85 + }, + "inputs": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "n": 29, + "units": { + "pinj": "MW", + "tinj": "N*m", + "ech_total": "MW", + "f1a": "A", + "f2a": "A", + "f3a": "A", + "f4a": "A", + "f5a": "A", + "f6a": "A", + "f7a": "A", + "f8a": "A", + "f9a": "A", + "f1b": "A", + "f2b": "A", + "f3b": "A", + "f4b": "A", + "f5b": "A", + "f6b": "A", + "f7b": "A", + "f8b": "A", + "f9b": "A", + "ecoila": "A", + "ecoilb": "A", + "gasa_cal": "Torr*L/s", + "gasb_cal": "Torr*L/s", + "gasc_cal": "Torr*L/s", + "gasd_cal": "Torr*L/s", + "gase_cal": "Torr*L/s", + "bt": "T" + }, + "sources": { + "pinj": "ptdata:bmspinj", + "tinj": "ptdata:bmstinj", + "ech_total": "ptdata:ECHPWR", + "f1a": "ptdata:F1A", + "f2a": "ptdata:F2A", + "f3a": "ptdata:F3A", + "f4a": "ptdata:F4A", + "f5a": "ptdata:F5A", + "f6a": "ptdata:F6A", + "f7a": "ptdata:F7A", + "f8a": "ptdata:F8A", + "f9a": "ptdata:F9A", + "f1b": "ptdata:F1B", + "f2b": "ptdata:F2B", + "f3b": "ptdata:F3B", + "f4b": "ptdata:F4B", + "f5b": "ptdata:F5B", + "f6b": "ptdata:F6B", + "f7b": "ptdata:F7B", + "f8b": "ptdata:F8B", + "f9b": "ptdata:F9B", + "ecoila": "ptdata:ECOILA", + "ecoilb": "ptdata:ECOILB", + "gasa_cal": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "gasb_cal": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "gasc_cal": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "gasd_cal": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "gase_cal": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "bt": "ptdata:bt" + }, + "descriptions": { + "pinj": "Neutral beam injected power, all sources.", + "tinj": "Neutral beam injected torque, all sources.", + "ech_total": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "f1a": "Shaping F-coil F1A current (bank A).", + "f2a": "Shaping F-coil F2A current (bank A).", + "f3a": "Shaping F-coil F3A current (bank A).", + "f4a": "Shaping F-coil F4A current (bank A).", + "f5a": "Shaping F-coil F5A current (bank A).", + "f6a": "Shaping F-coil F6A current (bank A).", + "f7a": "Shaping F-coil F7A current (bank A).", + "f8a": "Shaping F-coil F8A current (bank A).", + "f9a": "Shaping F-coil F9A current (bank A).", + "f1b": "Shaping F-coil F1B current (bank B).", + "f2b": "Shaping F-coil F2B current (bank B).", + "f3b": "Shaping F-coil F3B current (bank B).", + "f4b": "Shaping F-coil F4B current (bank B).", + "f5b": "Shaping F-coil F5B current (bank B).", + "f6b": "Shaping F-coil F6B current (bank B).", + "f7b": "Shaping F-coil F7B current (bank B).", + "f8b": "Shaping F-coil F8B current (bank B).", + "f9b": "Shaping F-coil F9B current (bank B).", + "ecoila": "Ohmic E-coil bank A current.", + "ecoilb": "Ohmic E-coil bank B current.", + "gasa_cal": "Calibrated gas injection flow, valve A.", + "gasb_cal": "Calibrated gas injection flow, valve B.", + "gasc_cal": "Calibrated gas injection flow, valve C.", + "gasd_cal": "Calibrated gas injection flow, valve D.", + "gase_cal": "Calibrated gas injection flow, valve E.", + "bt": "Vacuum toroidal magnetic field (signed)." + }, + "space": "raw physical units; the graph applies the z-score", + "note": "Check your units against actuator_ranges.json before trusting any output. A unit error produces confident nonsense rather than an exception." + }, + "outputs": { + "names": [ + "ne", + "te_ped", + "ti_ped", + "t_rot_ped", + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc", + "hmode" + ], + "n": 9, + "units": { + "ne": "1e19 m^-3", + "te_ped": "keV", + "ti_ped": "keV", + "t_rot_ped": "krad/s", + "neped_prmtan": "1e19 m^-3", + "teped_prmtan": "keV", + "rho_sym": "rho_tor (dimensionless)", + "ne_top_loc": "rho_tor (dimensionless)", + "hmode": "probability in [0, 1]" + }, + "note": "Physical units. hmode is a probability in [0, 1]; the graph applies the sigmoid.", + "hmode_gated": { + "heads": [ + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc" + ], + "indices": [ + 4, + 5, + 6, + 7 + ], + "threshold": 0.5, + "note": "These four heads were trained only on H-mode rows and are undefined otherwise. The graph does NOT gate them; the consumer must, using the model's own hmode output. See docs/GATING.md." + } + }, + "graphs": { + "fuse29_step.onnx": { + "purpose": "real-time, one 50 ms tick per call", + "inputs": { + "actuators": [ + "batch", + 29 + ], + "conv_state": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "outputs": { + "predictions": [ + "batch", + 9 + ], + "conv_state_out": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state_out": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "initial_state": "all zeros at the start of a shot", + "max_shot_length": "unbounded" + }, + "fuse29_seq.onnx": { + "purpose": "offline scoring of a whole shot", + "inputs": { + "actuators": [ + "batch", + 256, + 29 + ] + }, + "outputs": { + "predictions": [ + "batch", + 256, + 9 + ] + }, + "seq_len": 256, + "note": "Sequence length is FIXED. Right-pad shorter shots with zeros and read the first T outputs; the model is strictly causal so this is exact. For longer shots use the step graph or re-export with --seq-len." + } + }, + "dtype": "float32", + "onnx_opset": 17, + "training": { + "epoch": 22, + "val_loss": 1.1161801163107157, + "note": "See docs/TRAINING.md for the full recipe." + } +} diff --git a/s6/norms.json b/s6/norms.json new file mode 100644 index 0000000000000000000000000000000000000000..98c8c06209fd050ed78c21fa5b30afd95a71c171 --- /dev/null +++ b/s6/norms.json @@ -0,0 +1,292 @@ +{ + "schema_version": 2, + "note": "Statistics are baked into the shipped ONNX graphs. This file is for inspection and for reproducing the transform outside the graph; it is not required at inference time.", + "actuator_space": "physical", + "std_floor": 1e-06, + "clip_sigma": 20.0, + "provenance": { + "split": "train", + "n_shots": 32731, + "rho_index": 85, + "source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85, random stratified split (split_index.json)", + "note": "Recomputed on the NEW random train split. The source shards carried z-scores from the OLD chronological train split, whose shots overlap our test set. Actuator statistics are winsorised so a corrupted sample cannot set a channel's divisor.", + "inflated_channels": [ + "pinj", + "gasc_cal", + "gasd_cal", + "gase_cal" + ], + "actuator_estimator": "winsorised to p1..p99", + "actuator_space": "physical", + "composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "composition": "z = (x_phys - (m1 + s1*m2)) / (s1*s2), where (m1, s1) is the upstream FPE z-score and (m2, s2) is this model's re-scale onto its own training split" + }, + "actuators": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "mean": [ + 3.838883638381958, + 2.2043209075927734, + 2.6981112957000732, + -1382.3704833984375, + -1229.876708984375, + -592.7352294921875, + 1098.1622314453125, + 1173.57958984375, + -2493.411865234375, + -2367.570556640625, + 996.0214233398438, + -535.8018798828125, + -1373.1888427734375, + -1218.50048828125, + -1005.3848266601562, + 1124.2967529296875, + 1443.536865234375, + -2463.248046875, + -2941.56005859375, + 1431.05615234375, + -214.02586364746094, + -6965.32666015625, + -6876.16455078125, + 15.054444313049316, + 1.386172890663147, + 0.35034820437431335, + 0.528103232383728, + 0.27696067094802856, + -0.971906840801239 + ], + "std": [ + 3.0613932609558105, + 2.11222505569458, + 6.685519218444824, + 1349.629638671875, + 1248.3497314453125, + 1185.706298828125, + 1368.95458984375, + 1352.103759765625, + 1867.8076171875, + 1999.19970703125, + 1498.948974609375, + 1258.01171875, + 1367.82275390625, + 1316.67724609375, + 1308.8258056640625, + 1519.5994873046875, + 1408.3306884765625, + 1836.4208984375, + 2510.1083984375, + 1718.2965087890625, + 1388.83447265625, + 18940.9453125, + 18723.662109375, + 26.369497299194336, + 3.4090511798858643, + 0.4470684826374054, + 0.654624342918396, + 0.17616958916187286, + 1.6484158039093018 + ], + "transform": "z = clip((x - mean) / std, -clip_sigma, +clip_sigma), applied inside the graph" + }, + "targets": { + "ne": { + "mean": 2.7511744499206543, + "std": 1.654153823852539 + }, + "te_ped": { + "mean": 0.5915626287460327, + "std": 0.43467429280281067 + }, + "ti_ped": { + "mean": 1.016850233078003, + "std": 0.681096076965332 + }, + "t_rot_ped": { + "mean": 21.244613647460938, + "std": 16.59148406982422 + }, + "neped_prmtan": { + "mean": 2.7231285572052, + "std": 1.7005536556243896 + }, + "teped_prmtan": { + "mean": 0.46375223994255066, + "std": 0.36919456720352173 + }, + "rho_sym": { + "mean": 0.9757616519927979, + "std": 0.04329206794500351 + }, + "ne_top_loc": { + "mean": 0.9261865019798279, + "std": 0.049897171556949615 + } + }, + "hmode": { + "transform": "sigmoid", + "note": "hmode is a logit in the trunk; the graph applies the sigmoid." + }, + "stages": { + "note": "The composed actuator statistics above are the product of these two. Shown for traceability; use the composed values.", + "stage1_physical_to_fpe_zscore": { + "mean": [ + 2.8111997039100878, + 2.154143940948575, + 2.159654935239209, + -1444.0438445123289, + -1315.1185221229061, + -639.741760304047, + 1172.4978680515835, + 1222.4970107268077, + -2488.8410961768263, + -2491.3739557685253, + 1050.107386405324, + -578.9736547563273, + -1421.0817159358041, + -1285.3967398730092, + -1061.0290851406676, + 1186.4795970820587, + 1460.6822372728345, + -2452.093120847959, + -3071.3132492215186, + 1531.3304960724108, + -262.6728625067526, + -6887.604056684089, + -6768.996463787789, + 14.89178144369171, + 1.9421402622606716, + 0.7508911827356307, + 1.0383906373403984, + 0.3920832239686922, + -1.0310375752078498 + ], + "std": [ + 194.08418888726106, + 2.3684465859740262, + 5.948083564785035, + 1267.4907621702682, + 1217.4478106828162, + 1249.3915272640536, + 1345.3871181128568, + 1359.1934832307923, + 1887.1891497052302, + 1888.1014577442652, + 1559.9875106371376, + 1287.2118470203372, + 1271.813282654729, + 1259.8644805335082, + 1361.9306367877398, + 1521.172083160852, + 1393.2120473032558, + 1856.723912629122, + 2432.8530409799628, + 1705.6959050005082, + 1421.8036451037203, + 19092.148992270486, + 18858.28389193975, + 27.289184462156058, + 11.092415079529571, + 9.017289768908354, + 12.055982101097918, + 6.498888909025979, + 1.599000778986496 + ] + }, + "stage2_fpe_zscore_to_model": { + "mean": [ + 0.0052950419485569, + 0.02118559367954731, + 0.0905260294675827, + 0.04865782707929611, + 0.0700167864561081, + 0.03762352466583252, + -0.05525219440460205, + -0.03599006310105324, + -0.002421961398795247, + 0.06557027250528336, + -0.03467077016830444, + 0.03353898227214813, + 0.03765711933374405, + 0.05309795215725899, + 0.040856875479221344, + -0.04087827727198601, + -0.012306398712098598, + -0.006007813848555088, + 0.05333370715379715, + -0.05878793075680733, + 0.03421499580144882, + -0.004070908762514591, + -0.00568280229344964, + 0.005960696842521429, + -0.050121404230594635, + -0.04441944137215614, + -0.042326491326093674, + -0.017714189365506172, + 0.036979787051677704 + ], + "std": [ + 0.015773532912135124, + 0.8918187022209167, + 1.1239787340164185, + 1.0648043155670166, + 1.0253825187683105, + 0.9490270018577576, + 1.0175172090530396, + 0.994783878326416, + 0.9897299408912659, + 1.0588412284851074, + 0.9608724117279053, + 0.9773152470588684, + 1.0754902362823486, + 1.04509437084198, + 0.9610077142715454, + 0.9989661574363708, + 1.0108516216278076, + 0.9890651702880859, + 1.0317550897598267, + 1.007387399673462, + 0.9768117070198059, + 0.9920803308486938, + 0.9928614497184753, + 0.9662984609603882, + 0.30733174085617065, + 0.04957903176546097, + 0.05429871752858162, + 0.02710764855146408, + 1.030903697013855 + ] + } + } +} diff --git a/s6/provenance.json b/s6/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..1687b502262e61fa28960a4c3b28f66fdcd0762d --- /dev/null +++ b/s6/provenance.json @@ -0,0 +1,32 @@ +{ + "schema_version": 1, + "exported_utc": "2026-09-03T00:46:38.050137+00:00", + "seed": 6, + "source_checkpoint": "/flare/fusiondl_aesp/fuse_bd_model/fuse20/runs/fuse29r_s6/best_model.pt", + "source_checkpoint_sha256": "97dfda0fd4b6694275e532ce13555ffa1d3eba6b0cd4d0152d770465bc4cab79", + "norms_source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json", + "norms_actuator_space": "physical", + "norms_composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "onnx_opset": 17, + "exporter": "torch.onnx.export (TorchScript, dynamo=False)", + "versions": { + "torch": "2.10.0a0+git449b176", + "python": "3.12.12", + "platform": "Linux-5.14.21-150400.24.235-default-x86_64-with-glibc2.31", + "onnx": "1.22.0", + "onnxruntime": "1.29.0" + }, + "artifacts": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "36b55e194e705e0a1d1087c1164e4f72f2507784b1210a0ce2f94fa151db04fa" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "ca3570ae8e579c638d9195f6f7e3c4634bc61425cc51c7998a53818cb8c18ddb" + } + } +} diff --git a/s7/README.md b/s7/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8889834bfce2ad9e08a27721981325cd88abd11c --- /dev/null +++ b/s7/README.md @@ -0,0 +1,56 @@ +--- +license: mit +library_name: onnx +tags: + - onnx + - fusion + - plasma-physics + - tokamak + - diii-d + - mamba +--- + +# fuse29 — seed 7 + +This is seed 7, one of eight independently trained runs. Seed 0 is the champion and the default; this one exists so you can measure spread across training runs. Unless you are doing that, you want seed 0. + +29-input Mamba-2 pedestal predictor for DIII-D. Raw physical units in, +physical units out. See the [root model card](https://huggingface.co/SCS-Lab/FUSE29-Pedestal-model) +for the full description, I/O contract, accuracy and limitations. + +| | | +|---|---| +| Seed | 7 | +| Parameters | 11,254,425 | +| Best validation loss | 1.1130 | +| Sequence graph length | 256 ticks | +| ONNX opset | 17 | +| Exported | 2026-09-03T00:46:41.200737+00:00 | +| Source checkpoint SHA-256 | `de45313df2c4b1c4…` | + +## Load + +```python +from fuse29.runtime import Fuse29Predictor + +predictor = Fuse29Predictor.from_pretrained("SCS-Lab/FUSE29-Pedestal-model", seed=7) +``` + +## Files + +| File | | +|---|---| +| `fuse29_step.onnx` | one 50 ms tick, carries state, no length limit | +| `fuse29_seq.onnx` | whole shot at a fixed 256 ticks | +| `model_config.json` | I/O contract: names, order, units, sources, shapes | +| `norms.json` | the statistics baked into the graphs | +| `actuator_ranges.json` | training-split distribution, for checking your units | +| `provenance.json` | source checkpoint hash, library versions, artefact hashes | + +## Before you use it + +- Four heads (`neped_prmtan`, `teped_prmtan`, `rho_sym`, `ne_top_loc`) are + **only valid in H-mode** and the graph does not gate them. Gate on the + model's own `hmode` output. +- `pinj` is in **MW**, not W. Run `predictor.check_units(shot)` once. +- Output column order is not alphabetical. See `model_config.json`. diff --git a/s7/actuator_ranges.json b/s7/actuator_ranges.json new file mode 100644 index 0000000000000000000000000000000000000000..08d19f4e80f49e6bbd18c40674b06946a02cc61a --- /dev/null +++ b/s7/actuator_ranges.json @@ -0,0 +1,600 @@ +{ + "schema_version": 1, + "note": "Physical-units distribution of each actuator over the training split. Use it to check that your signals are in the units the graph expects; a unit error is the one preprocessing mistake that produces confident nonsense rather than an exception.", + "split": "train", + "n_shots": 32731, + "n_ticks": 3020926, + "percentiles": [ + 0.1, + 1, + 5, + 25, + 50, + 75, + 95, + 99, + 99.9 + ], + "channels": { + "pinj": { + "units": "MW", + "source": "ptdata:bmspinj", + "description": "Neutral beam injected power, all sources.", + "min": -46005.02701919088, + "max": 17.512712760455507, + "mean": 3.838883638381958, + "std": 3.0613932609558105, + "pct": { + "0.1": -0.004132416388869853, + "1": 4.112187479421436e-09, + "5": 4.112187479421436e-09, + "25": 1.311169336894574, + "50": 3.18466408866965, + "75": 5.748764762873332, + "95": 9.841882532311711, + "99": 12.212702351352696, + "99.9": 14.791924355083399 + } + }, + "tinj": { + "units": "N*m", + "source": "ptdata:bmstinj", + "description": "Neutral beam injected torque, all sources.", + "min": -56.644382966354534, + "max": 129.9833380295058, + "mean": 2.2043209075927734, + "std": 2.11222505569458, + "pct": { + "0.1": -2.0636791725994676, + "1": -0.5384317586520496, + "5": -1.6338495756329507e-07, + "25": 0.4319133403840452, + "50": 1.963846077087278, + "75": 3.1821234334199193, + "95": 6.641525317445799, + "99": 8.941231792062355, + "99.9": 11.156712776956862 + } + }, + "ech_total": { + "units": "MW", + "source": "ptdata:ECHPWR", + "description": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "min": -19.31181996542309, + "max": 40.286455582885246, + "mean": 2.6981112957000732, + "std": 6.685519218444824, + "pct": { + "0.1": -1.0663586061709935, + "1": -0.09982622583332723, + "5": -0.020836448436920674, + "25": -3.2566890961760464e-08, + "50": -3.2566890961760464e-08, + "75": 1.1717011943616973, + "95": 21.558252060431304, + "99": 30.476182922859127, + "99.9": 37.09168917133024 + } + }, + "f1a": { + "units": "A", + "source": "ptdata:F1A", + "description": "Shaping F-coil F1A current (bank A).", + "min": -5776.925892871883, + "max": 5794.3504737288395, + "mean": -1382.3704833984375, + "std": 1349.629638671875, + "pct": { + "0.1": -4852.691808601986, + "1": -4131.456225748339, + "5": -3401.8604035239678, + "25": -2236.4754469921672, + "50": -1501.5458201268116, + "75": -660.4245966463927, + "95": 1294.4315819071094, + "99": 3103.250955923345, + "99.9": 4467.289606367005 + } + }, + "f2a": { + "units": "A", + "source": "ptdata:F2A", + "description": "Shaping F-coil F2A current (bank A).", + "min": -5716.347659616551, + "max": 5702.840977614059, + "mean": -1229.876708984375, + "std": 1248.3497314453125, + "pct": { + "0.1": -4093.397230708888, + "1": -3297.8668360449756, + "5": -2712.522533155646, + "25": -2004.455454331444, + "50": -1443.842241803098, + "75": -854.5004209979342, + "95": 1825.579117167513, + "99": 3097.0902901803724, + "99.9": 3899.548655232026 + } + }, + "f3a": { + "units": "A", + "source": "ptdata:F3A", + "description": "Shaping F-coil F3A current (bank A).", + "min": -5498.272347966228, + "max": 5321.719922394657, + "mean": -592.7352294921875, + "std": 1185.706298828125, + "pct": { + "0.1": -4140.690909683277, + "1": -3539.2136012211317, + "5": -2813.2888996278725, + "25": -1377.7435033975407, + "50": -152.16189816331342, + "75": 2.4453898354848604, + "95": 1203.107532773337, + "99": 2898.3184344684487, + "99.9": 3780.0556837479485 + } + }, + "f4a": { + "units": "A", + "source": "ptdata:F4A", + "description": "Shaping F-coil F4A current (bank A).", + "min": -5876.373800845117, + "max": 5855.700219305917, + "mean": 1098.1622314453125, + "std": 1368.95458984375, + "pct": { + "0.1": -4331.218505807293, + "1": -3344.4526378786877, + "5": -1858.4157962413597, + "25": 395.84891116184133, + "50": 1143.436262581068, + "75": 1990.2677717095535, + "95": 3141.5448401142426, + "99": 3756.430079500399, + "99.9": 4525.754910416766 + } + }, + "f5a": { + "units": "A", + "source": "ptdata:F5A", + "description": "Shaping F-coil F5A current (bank A).", + "min": -5178.8539079385355, + "max": 5353.141466672798, + "mean": 1173.57958984375, + "std": 1352.103759765625, + "pct": { + "0.1": -4592.7059148331355, + "1": -3597.7201189044818, + "5": -1551.4942446467403, + "25": 543.836095032849, + "50": 1273.969119983141, + "75": 2051.0443148459794, + "95": 3019.669622905384, + "99": 3875.454685744494, + "99.9": 4738.506855960392 + } + }, + "f6a": { + "units": "A", + "source": "ptdata:F6A", + "description": "Shaping F-coil F6A current (bank A).", + "min": -7929.903731492232, + "max": 5741.056818467809, + "mean": -2493.411865234375, + "std": 1867.8076171875, + "pct": { + "0.1": -6125.90268588119, + "1": -4963.398523516425, + "5": -4319.477588996284, + "25": -3574.8234234024885, + "50": -2898.635802832382, + "75": -2143.0930801744807, + "95": 2999.75903843203, + "99": 4137.6543157735705, + "99.9": 4783.375582166487 + } + }, + "f7a": { + "units": "A", + "source": "ptdata:F7A", + "description": "Shaping F-coil F7A current (bank A).", + "min": -9825.736080045011, + "max": 8678.484606762057, + "mean": -2367.570556640625, + "std": 1999.19970703125, + "pct": { + "0.1": -7676.219824168618, + "1": -6127.379912259545, + "5": -4909.893927511103, + "25": -3430.1309476786882, + "50": -2697.460342263373, + "75": -1913.0579478721388, + "95": 2723.164038733837, + "99": 3948.221013655396, + "99.9": 5316.086800760559 + } + }, + "f8a": { + "units": "A", + "source": "ptdata:F8A", + "description": "Shaping F-coil F8A current (bank A).", + "min": -5378.835169240788, + "max": 5880.767402237174, + "mean": 996.0214233398438, + "std": 1498.948974609375, + "pct": { + "0.1": -4229.744640827867, + "1": -3363.368412210415, + "5": -1922.2114690963926, + "25": 60.761390529545906, + "50": 1153.9241798399726, + "75": 1951.1572686642544, + "95": 3318.078493605748, + "99": 3973.7764489149104, + "99.9": 4670.296725684707 + } + }, + "f9a": { + "units": "A", + "source": "ptdata:F9A", + "description": "Shaping F-coil F9A current (bank A).", + "min": -7206.032812499594, + "max": 8700.684616308497, + "mean": -535.8018798828125, + "std": 1258.01171875, + "pct": { + "0.1": -4739.927394914494, + "1": -3344.557163847978, + "5": -2567.420669960383, + "25": -1538.6304412830955, + "50": -578.9736547563273, + "75": 353.08467764596537, + "95": 1558.2607279613098, + "99": 2657.691791383836, + "99.9": 4334.930796170508 + } + }, + "f1b": { + "units": "A", + "source": "ptdata:F1B", + "description": "Shaping F-coil F1B current (bank B).", + "min": -5921.943154546981, + "max": 5407.326196618229, + "mean": -1373.1888427734375, + "std": 1367.82275390625, + "pct": { + "0.1": -5179.567735964654, + "1": -4339.478258925401, + "5": -3463.431883510691, + "25": -2205.922070942479, + "50": -1459.5306304510002, + "75": -750.1948036110768, + "95": 1428.796834935177, + "99": 3233.0438718527407, + "99.9": 4240.724502122051 + } + }, + "f2b": { + "units": "A", + "source": "ptdata:F2B", + "description": "Shaping F-coil F2B current (bank B).", + "min": -5788.286812358208, + "max": 5428.562849130928, + "mean": -1218.50048828125, + "std": 1316.67724609375, + "pct": { + "0.1": -4785.998935671587, + "1": -3520.521383204173, + "5": -2855.1671089762676, + "25": -1969.483606794242, + "50": -1447.1879016413761, + "75": -866.6265611311096, + "95": 2049.217650390811, + "99": 3312.4349928765846, + "99.9": 4011.5142868858347 + } + }, + "f3b": { + "units": "A", + "source": "ptdata:F3B", + "description": "Shaping F-coil F3B current (bank B).", + "min": -5503.943071765381, + "max": 4849.177948074737, + "mean": -1005.3848266601562, + "std": 1308.8258056640625, + "pct": { + "0.1": -4452.6277480541985, + "1": -3641.634707712471, + "5": -2937.4861003450947, + "25": -1881.7475544966392, + "50": -1170.6945714968547, + "75": -124.13671681902403, + "95": 1683.5400540223286, + "99": 3015.8060365193123, + "99.9": 3797.6599244161957 + } + }, + "f4b": { + "units": "A", + "source": "ptdata:F4B", + "description": "Shaping F-coil F4B current (bank B).", + "min": -5829.242194941551, + "max": 5787.149431930685, + "mean": 1124.2967529296875, + "std": 1519.5994873046875, + "pct": { + "0.1": -4083.976449898858, + "1": -3247.08251902718, + "5": -2270.942268479742, + "25": 376.8608226937906, + "50": 1392.450441038166, + "75": 2146.7001303629104, + "95": 3145.5476189867913, + "99": 3926.614817946318, + "99.9": 4582.551950710075 + } + }, + "f5b": { + "units": "A", + "source": "ptdata:F5B", + "description": "Shaping F-coil F5B current (bank B).", + "min": -5213.110339059254, + "max": 5388.213772287713, + "mean": 1443.536865234375, + "std": 1408.3306884765625, + "pct": { + "0.1": -4134.61747806435, + "1": -3056.873937432705, + "5": -1361.0988601293998, + "25": 675.1515533174199, + "50": 1572.802070225599, + "75": 2367.5452263604984, + "95": 3528.863240540377, + "99": 4411.454242162536, + "99.9": 4967.30642206674 + } + }, + "f6b": { + "units": "A", + "source": "ptdata:F6B", + "description": "Shaping F-coil F6B current (bank B).", + "min": -7604.653108484432, + "max": 7763.1261416792295, + "mean": -2463.248046875, + "std": 1836.4208984375, + "pct": { + "0.1": -6372.627428710043, + "1": -5251.4106280007745, + "5": -4318.157196234368, + "25": -3524.5849152058445, + "50": -2837.2759930056304, + "75": -2089.94465303326, + "95": 2871.6849973390945, + "99": 3948.010461650111, + "99.9": 4803.251616324593 + } + }, + "f7b": { + "units": "A", + "source": "ptdata:F7B", + "description": "Shaping F-coil F7B current (bank B).", + "min": -11380.254539563213, + "max": 9414.242772782009, + "mean": -2941.56005859375, + "std": 2510.1083984375, + "pct": { + "0.1": -9236.286164628174, + "1": -7962.01372128499, + "5": -6618.689743738845, + "25": -4397.68407591947, + "50": -3041.7944101983817, + "75": -2113.0768216001165, + "95": 2850.240503964187, + "99": 5238.131223534479, + "99.9": 6771.41582857779 + } + }, + "f8b": { + "units": "A", + "source": "ptdata:F8B", + "description": "Shaping F-coil F8B current (bank B).", + "min": -5834.457886045129, + "max": 5952.292180058913, + "mean": 1431.05615234375, + "std": 1718.2965087890625, + "pct": { + "0.1": -4377.886849186064, + "1": -3547.8568327724756, + "5": -2536.325388000092, + "25": 592.1441487378677, + "50": 1743.1741236182588, + "75": 2613.9050347435855, + "95": 3655.019608301406, + "99": 4295.252919476556, + "99.9": 5183.621783504976 + } + }, + "f9b": { + "units": "A", + "source": "ptdata:F9B", + "description": "Shaping F-coil F9B current (bank B).", + "min": -7298.33418485197, + "max": 8673.475372842513, + "mean": -214.02586364746094, + "std": 1388.83447265625, + "pct": { + "0.1": -4443.002941036773, + "1": -3335.961239603393, + "5": -2530.3434455144015, + "25": -1111.6205754278508, + "50": -212.41719832099042, + "75": 564.1401009862525, + "95": 2296.158459733251, + "99": 3401.023805016151, + "99.9": 4981.695296538042 + } + }, + "ecoila": { + "units": "A", + "source": "ptdata:ECOILA", + "description": "Ohmic E-coil bank A current.", + "min": -68526.67779690563, + "max": 65669.33446503483, + "mean": -6965.32666015625, + "std": 18940.9453125, + "pct": { + "0.1": -62521.0592220894, + "1": -53449.0677376177, + "5": -39610.65329064206, + "25": -19599.348704727538, + "50": -6887.604056684089, + "75": 6065.040591650557, + "95": 23926.96154448237, + "99": 33650.27142286909, + "99.9": 48164.54971213867 + } + }, + "ecoilb": { + "units": "A", + "source": "ptdata:ECOILB", + "description": "Ohmic E-coil bank B current.", + "min": -67880.78461590248, + "max": 67380.80764904841, + "mean": -6876.16455078125, + "std": 18723.662109375, + "pct": { + "0.1": -61839.528701402356, + "1": -52787.079189397904, + "5": -39153.2527665565, + "25": -19383.82435886666, + "50": -6768.996463787789, + "75": 6013.297288247475, + "95": 23686.641557508636, + "99": 33187.653018934754, + "99.9": 47362.43837391052 + } + }, + "gasa_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "description": "Calibrated gas injection flow, valve A.", + "min": -0.9805486760911233, + "max": 348.1779045740827, + "mean": 15.054444313049316, + "std": 26.369497299194336, + "pct": { + "0.1": -0.0181447514768128, + "1": 0.0006228885411054819, + "5": 0.0014589414841879034, + "25": 0.00852798057103854, + "50": 0.09974314587981326, + "75": 19.645558552678416, + "95": 71.02669389337856, + "99": 137.36341388263276, + "99.9": 211.79616738152396 + } + }, + "gasb_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "description": "Calibrated gas injection flow, valve B.", + "min": -0.5231055139632899, + "max": 317.69717326145866, + "mean": 1.386172890663147, + "std": 3.4090511798858643, + "pct": { + "0.1": 9.14047308575583e-06, + "1": 0.0007714573310613204, + "5": 0.002068321612864521, + "25": 0.009055124211873267, + "50": 0.07339015461169385, + "75": 1.9421402622606716, + "95": 1.9421402622606716, + "99": 23.663863921838843, + "99.9": 149.40068998150738 + } + }, + "gasc_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "description": "Calibrated gas injection flow, valve C.", + "min": -0.3965804467767108, + "max": 306.0269668007428, + "mean": 0.35034820437431335, + "std": 0.4470684826374054, + "pct": { + "0.1": 7.428448363699935e-05, + "1": 0.00026770734685732656, + "5": 0.0006667805693404416, + "25": 0.002788385500787083, + "50": 0.023577950502740697, + "75": 0.7508911827356307, + "95": 0.7508911827356307, + "99": 2.733332630282, + "99.9": 108.67323889612304 + } + }, + "gasd_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "description": "Calibrated gas injection flow, valve D.", + "min": -0.5287260135880842, + "max": 771.5043798529183, + "mean": 0.528103232383728, + "std": 0.654624342918396, + "pct": { + "0.1": 5.497087182604332e-05, + "1": 0.000175335120693898, + "5": 0.0005482846440516553, + "25": 0.003719433481388368, + "50": 0.08385269566973214, + "75": 1.0383906373403984, + "95": 1.0383906373403984, + "99": 4.359676988215197, + "99.9": 127.54440071212512 + } + }, + "gase_cal": { + "units": "Torr*L/s", + "source": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "description": "Calibrated gas injection flow, valve E.", + "min": -0.2211384331710633, + "max": 672.8582070151267, + "mean": 0.27696067094802856, + "std": 0.17616958916187286, + "pct": { + "0.1": 0.00010156410138473793, + "1": 0.000223585566083373, + "5": 0.0005190716405260032, + "25": 0.011627604901727706, + "50": 0.3920832239686922, + "75": 0.3920832239686922, + "95": 0.3920832239686922, + "99": 0.3920832239686922, + "99.9": 29.75536079519976 + } + }, + "bt": { + "units": "T", + "source": "ptdata:bt", + "description": "Vacuum toroidal magnetic field (signed).", + "min": -2.2353815075115375, + "max": 2.25186423641397, + "mean": -0.971906840801239, + "std": 1.6484158039093018, + "pct": { + "0.1": -2.2151064134142304, + "1": -2.1819873443702726, + "5": -2.136304350652244, + "25": -2.0446028795017246, + "50": -1.8984274308309796, + "75": -1.0260122281948352, + "95": 2.053318112027725, + "99": 2.10945640328767, + "99.9": 2.1819705410137904 + } + } + } +} diff --git a/s7/fuse29_seq.onnx b/s7/fuse29_seq.onnx new file mode 100644 index 0000000000000000000000000000000000000000..f377869ecb6eb656b267de7e60a9b55e36814218 --- /dev/null +++ b/s7/fuse29_seq.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db040b029538d47b404e9864538fb0c550285081ecce7348ad6fd231fdd7bbcf +size 45464382 diff --git a/s7/fuse29_step.onnx b/s7/fuse29_step.onnx new file mode 100644 index 0000000000000000000000000000000000000000..76f60b9b18487d888c1a97ba379765ac7cdf4536 --- /dev/null +++ b/s7/fuse29_step.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abf72130ad644f7bf2883c39f336536ad839ae7f609cc88d28a5366459e1693c +size 45081271 diff --git a/s7/model_config.json b/s7/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..7892bb70d343b25769899d1fce0b9586a64b5306 --- /dev/null +++ b/s7/model_config.json @@ -0,0 +1,268 @@ +{ + "schema_version": 1, + "model": "fuse29", + "seed": 7, + "description": "29-input Mamba-2 pedestal predictor for DIII-D. Strictly causal, 20 Hz, nine heads at rho_tor = 0.85.", + "architecture": { + "family": "Mamba-2 (structured state-space duality)", + "d_model": 512, + "n_layers": 6, + "d_state": 128, + "d_conv": 4, + "expand": 2, + "headdim": 128, + "nheads": 8, + "ngroups": 2, + "chunk_size": 100, + "d_inner": 1024, + "conv_dim": 1536, + "n_params": 11254425 + }, + "cadence": { + "hz": 20, + "period_ms": 50.0, + "rho_tor": 0.85 + }, + "inputs": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "n": 29, + "units": { + "pinj": "MW", + "tinj": "N*m", + "ech_total": "MW", + "f1a": "A", + "f2a": "A", + "f3a": "A", + "f4a": "A", + "f5a": "A", + "f6a": "A", + "f7a": "A", + "f8a": "A", + "f9a": "A", + "f1b": "A", + "f2b": "A", + "f3b": "A", + "f4b": "A", + "f5b": "A", + "f6b": "A", + "f7b": "A", + "f8b": "A", + "f9b": "A", + "ecoila": "A", + "ecoilb": "A", + "gasa_cal": "Torr*L/s", + "gasb_cal": "Torr*L/s", + "gasc_cal": "Torr*L/s", + "gasd_cal": "Torr*L/s", + "gase_cal": "Torr*L/s", + "bt": "T" + }, + "sources": { + "pinj": "ptdata:bmspinj", + "tinj": "ptdata:bmstinj", + "ech_total": "ptdata:ECHPWR", + "f1a": "ptdata:F1A", + "f2a": "ptdata:F2A", + "f3a": "ptdata:F3A", + "f4a": "ptdata:F4A", + "f5a": "ptdata:F5A", + "f6a": "ptdata:F6A", + "f7a": "ptdata:F7A", + "f8a": "ptdata:F8A", + "f9a": "ptdata:F9A", + "f1b": "ptdata:F1B", + "f2b": "ptdata:F2B", + "f3b": "ptdata:F3B", + "f4b": "ptdata:F4B", + "f5b": "ptdata:F5B", + "f6b": "ptdata:F6B", + "f7b": "ptdata:F7B", + "f8b": "ptdata:F8B", + "f9b": "ptdata:F9B", + "ecoila": "ptdata:ECOILA", + "ecoilb": "ptdata:ECOILB", + "gasa_cal": "tree:NEUTRALS GASFLOW.GASA:FLOW", + "gasb_cal": "tree:NEUTRALS GASFLOW.GASB:FLOW", + "gasc_cal": "tree:NEUTRALS GASFLOW.GASC:FLOW", + "gasd_cal": "tree:NEUTRALS GASFLOW.GASD:FLOW", + "gase_cal": "tree:NEUTRALS GASFLOW.GASE:FLOW", + "bt": "ptdata:bt" + }, + "descriptions": { + "pinj": "Neutral beam injected power, all sources.", + "tinj": "Neutral beam injected torque, all sources.", + "ech_total": "Total electron cyclotron heating power (see note in docs/PREPROCESSING.md on this channel's scaling).", + "f1a": "Shaping F-coil F1A current (bank A).", + "f2a": "Shaping F-coil F2A current (bank A).", + "f3a": "Shaping F-coil F3A current (bank A).", + "f4a": "Shaping F-coil F4A current (bank A).", + "f5a": "Shaping F-coil F5A current (bank A).", + "f6a": "Shaping F-coil F6A current (bank A).", + "f7a": "Shaping F-coil F7A current (bank A).", + "f8a": "Shaping F-coil F8A current (bank A).", + "f9a": "Shaping F-coil F9A current (bank A).", + "f1b": "Shaping F-coil F1B current (bank B).", + "f2b": "Shaping F-coil F2B current (bank B).", + "f3b": "Shaping F-coil F3B current (bank B).", + "f4b": "Shaping F-coil F4B current (bank B).", + "f5b": "Shaping F-coil F5B current (bank B).", + "f6b": "Shaping F-coil F6B current (bank B).", + "f7b": "Shaping F-coil F7B current (bank B).", + "f8b": "Shaping F-coil F8B current (bank B).", + "f9b": "Shaping F-coil F9B current (bank B).", + "ecoila": "Ohmic E-coil bank A current.", + "ecoilb": "Ohmic E-coil bank B current.", + "gasa_cal": "Calibrated gas injection flow, valve A.", + "gasb_cal": "Calibrated gas injection flow, valve B.", + "gasc_cal": "Calibrated gas injection flow, valve C.", + "gasd_cal": "Calibrated gas injection flow, valve D.", + "gase_cal": "Calibrated gas injection flow, valve E.", + "bt": "Vacuum toroidal magnetic field (signed)." + }, + "space": "raw physical units; the graph applies the z-score", + "note": "Check your units against actuator_ranges.json before trusting any output. A unit error produces confident nonsense rather than an exception." + }, + "outputs": { + "names": [ + "ne", + "te_ped", + "ti_ped", + "t_rot_ped", + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc", + "hmode" + ], + "n": 9, + "units": { + "ne": "1e19 m^-3", + "te_ped": "keV", + "ti_ped": "keV", + "t_rot_ped": "krad/s", + "neped_prmtan": "1e19 m^-3", + "teped_prmtan": "keV", + "rho_sym": "rho_tor (dimensionless)", + "ne_top_loc": "rho_tor (dimensionless)", + "hmode": "probability in [0, 1]" + }, + "note": "Physical units. hmode is a probability in [0, 1]; the graph applies the sigmoid.", + "hmode_gated": { + "heads": [ + "neped_prmtan", + "teped_prmtan", + "rho_sym", + "ne_top_loc" + ], + "indices": [ + 4, + 5, + 6, + 7 + ], + "threshold": 0.5, + "note": "These four heads were trained only on H-mode rows and are undefined otherwise. The graph does NOT gate them; the consumer must, using the model's own hmode output. See docs/GATING.md." + } + }, + "graphs": { + "fuse29_step.onnx": { + "purpose": "real-time, one 50 ms tick per call", + "inputs": { + "actuators": [ + "batch", + 29 + ], + "conv_state": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "outputs": { + "predictions": [ + "batch", + 9 + ], + "conv_state_out": [ + 6, + "batch", + 1536, + 3 + ], + "ssm_state_out": [ + 6, + "batch", + 8, + 128, + 128 + ] + }, + "initial_state": "all zeros at the start of a shot", + "max_shot_length": "unbounded" + }, + "fuse29_seq.onnx": { + "purpose": "offline scoring of a whole shot", + "inputs": { + "actuators": [ + "batch", + 256, + 29 + ] + }, + "outputs": { + "predictions": [ + "batch", + 256, + 9 + ] + }, + "seq_len": 256, + "note": "Sequence length is FIXED. Right-pad shorter shots with zeros and read the first T outputs; the model is strictly causal so this is exact. For longer shots use the step graph or re-export with --seq-len." + } + }, + "dtype": "float32", + "onnx_opset": 17, + "training": { + "epoch": 19, + "val_loss": 1.112956801429391, + "note": "See docs/TRAINING.md for the full recipe." + } +} diff --git a/s7/norms.json b/s7/norms.json new file mode 100644 index 0000000000000000000000000000000000000000..98c8c06209fd050ed78c21fa5b30afd95a71c171 --- /dev/null +++ b/s7/norms.json @@ -0,0 +1,292 @@ +{ + "schema_version": 2, + "note": "Statistics are baked into the shipped ONNX graphs. This file is for inspection and for reproducing the transform outside the graph; it is not required at inference time.", + "actuator_space": "physical", + "std_floor": 1e-06, + "clip_sigma": 20.0, + "provenance": { + "split": "train", + "n_shots": 32731, + "rho_index": 85, + "source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85, random stratified split (split_index.json)", + "note": "Recomputed on the NEW random train split. The source shards carried z-scores from the OLD chronological train split, whose shots overlap our test set. Actuator statistics are winsorised so a corrupted sample cannot set a channel's divisor.", + "inflated_channels": [ + "pinj", + "gasc_cal", + "gasd_cal", + "gase_cal" + ], + "actuator_estimator": "winsorised to p1..p99", + "actuator_space": "physical", + "composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "composition": "z = (x_phys - (m1 + s1*m2)) / (s1*s2), where (m1, s1) is the upstream FPE z-score and (m2, s2) is this model's re-scale onto its own training split" + }, + "actuators": { + "names": [ + "pinj", + "tinj", + "ech_total", + "f1a", + "f2a", + "f3a", + "f4a", + "f5a", + "f6a", + "f7a", + "f8a", + "f9a", + "f1b", + "f2b", + "f3b", + "f4b", + "f5b", + "f6b", + "f7b", + "f8b", + "f9b", + "ecoila", + "ecoilb", + "gasa_cal", + "gasb_cal", + "gasc_cal", + "gasd_cal", + "gase_cal", + "bt" + ], + "mean": [ + 3.838883638381958, + 2.2043209075927734, + 2.6981112957000732, + -1382.3704833984375, + -1229.876708984375, + -592.7352294921875, + 1098.1622314453125, + 1173.57958984375, + -2493.411865234375, + -2367.570556640625, + 996.0214233398438, + -535.8018798828125, + -1373.1888427734375, + -1218.50048828125, + -1005.3848266601562, + 1124.2967529296875, + 1443.536865234375, + -2463.248046875, + -2941.56005859375, + 1431.05615234375, + -214.02586364746094, + -6965.32666015625, + -6876.16455078125, + 15.054444313049316, + 1.386172890663147, + 0.35034820437431335, + 0.528103232383728, + 0.27696067094802856, + -0.971906840801239 + ], + "std": [ + 3.0613932609558105, + 2.11222505569458, + 6.685519218444824, + 1349.629638671875, + 1248.3497314453125, + 1185.706298828125, + 1368.95458984375, + 1352.103759765625, + 1867.8076171875, + 1999.19970703125, + 1498.948974609375, + 1258.01171875, + 1367.82275390625, + 1316.67724609375, + 1308.8258056640625, + 1519.5994873046875, + 1408.3306884765625, + 1836.4208984375, + 2510.1083984375, + 1718.2965087890625, + 1388.83447265625, + 18940.9453125, + 18723.662109375, + 26.369497299194336, + 3.4090511798858643, + 0.4470684826374054, + 0.654624342918396, + 0.17616958916187286, + 1.6484158039093018 + ], + "transform": "z = clip((x - mean) / std, -clip_sigma, +clip_sigma), applied inside the graph" + }, + "targets": { + "ne": { + "mean": 2.7511744499206543, + "std": 1.654153823852539 + }, + "te_ped": { + "mean": 0.5915626287460327, + "std": 0.43467429280281067 + }, + "ti_ped": { + "mean": 1.016850233078003, + "std": 0.681096076965332 + }, + "t_rot_ped": { + "mean": 21.244613647460938, + "std": 16.59148406982422 + }, + "neped_prmtan": { + "mean": 2.7231285572052, + "std": 1.7005536556243896 + }, + "teped_prmtan": { + "mean": 0.46375223994255066, + "std": 0.36919456720352173 + }, + "rho_sym": { + "mean": 0.9757616519927979, + "std": 0.04329206794500351 + }, + "ne_top_loc": { + "mean": 0.9261865019798279, + "std": 0.049897171556949615 + } + }, + "hmode": { + "transform": "sigmoid", + "note": "hmode is a logit in the trunk; the graph applies the sigmoid." + }, + "stages": { + "note": "The composed actuator statistics above are the product of these two. Shown for traceability; use the composed values.", + "stage1_physical_to_fpe_zscore": { + "mean": [ + 2.8111997039100878, + 2.154143940948575, + 2.159654935239209, + -1444.0438445123289, + -1315.1185221229061, + -639.741760304047, + 1172.4978680515835, + 1222.4970107268077, + -2488.8410961768263, + -2491.3739557685253, + 1050.107386405324, + -578.9736547563273, + -1421.0817159358041, + -1285.3967398730092, + -1061.0290851406676, + 1186.4795970820587, + 1460.6822372728345, + -2452.093120847959, + -3071.3132492215186, + 1531.3304960724108, + -262.6728625067526, + -6887.604056684089, + -6768.996463787789, + 14.89178144369171, + 1.9421402622606716, + 0.7508911827356307, + 1.0383906373403984, + 0.3920832239686922, + -1.0310375752078498 + ], + "std": [ + 194.08418888726106, + 2.3684465859740262, + 5.948083564785035, + 1267.4907621702682, + 1217.4478106828162, + 1249.3915272640536, + 1345.3871181128568, + 1359.1934832307923, + 1887.1891497052302, + 1888.1014577442652, + 1559.9875106371376, + 1287.2118470203372, + 1271.813282654729, + 1259.8644805335082, + 1361.9306367877398, + 1521.172083160852, + 1393.2120473032558, + 1856.723912629122, + 2432.8530409799628, + 1705.6959050005082, + 1421.8036451037203, + 19092.148992270486, + 18858.28389193975, + 27.289184462156058, + 11.092415079529571, + 9.017289768908354, + 12.055982101097918, + 6.498888909025979, + 1.599000778986496 + ] + }, + "stage2_fpe_zscore_to_model": { + "mean": [ + 0.0052950419485569, + 0.02118559367954731, + 0.0905260294675827, + 0.04865782707929611, + 0.0700167864561081, + 0.03762352466583252, + -0.05525219440460205, + -0.03599006310105324, + -0.002421961398795247, + 0.06557027250528336, + -0.03467077016830444, + 0.03353898227214813, + 0.03765711933374405, + 0.05309795215725899, + 0.040856875479221344, + -0.04087827727198601, + -0.012306398712098598, + -0.006007813848555088, + 0.05333370715379715, + -0.05878793075680733, + 0.03421499580144882, + -0.004070908762514591, + -0.00568280229344964, + 0.005960696842521429, + -0.050121404230594635, + -0.04441944137215614, + -0.042326491326093674, + -0.017714189365506172, + 0.036979787051677704 + ], + "std": [ + 0.015773532912135124, + 0.8918187022209167, + 1.1239787340164185, + 1.0648043155670166, + 1.0253825187683105, + 0.9490270018577576, + 1.0175172090530396, + 0.994783878326416, + 0.9897299408912659, + 1.0588412284851074, + 0.9608724117279053, + 0.9773152470588684, + 1.0754902362823486, + 1.04509437084198, + 0.9610077142715454, + 0.9989661574363708, + 1.0108516216278076, + 0.9890651702880859, + 1.0317550897598267, + 1.007387399673462, + 0.9768117070198059, + 0.9920803308486938, + 0.9928614497184753, + 0.9662984609603882, + 0.30733174085617065, + 0.04957903176546097, + 0.05429871752858162, + 0.02710764855146408, + 1.030903697013855 + ] + } + } +} diff --git a/s7/provenance.json b/s7/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..ee94c3924ecabee3ec3bd1d5c9eae78ff48c8a85 --- /dev/null +++ b/s7/provenance.json @@ -0,0 +1,32 @@ +{ + "schema_version": 1, + "exported_utc": "2026-09-03T00:46:41.200737+00:00", + "seed": 7, + "source_checkpoint": "/flare/fusiondl_aesp/fuse_bd_model/fuse20/runs/fuse29r_s7/best_model.pt", + "source_checkpoint_sha256": "de45313df2c4b1c42dd9fb9fb5055a139f83d9fff0d942b5b4f7ecfb38862a34", + "norms_source": "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json", + "norms_actuator_space": "physical", + "norms_composed_from": [ + "/lus/flare/projects/fusiondl_aesp/d3d_pedestal_fpe_harrisn85/normalization_params.json", + "/lus/flare/projects/fusiondl_aesp/d3d_fuse20_rho85/norms.json" + ], + "onnx_opset": 17, + "exporter": "torch.onnx.export (TorchScript, dynamo=False)", + "versions": { + "torch": "2.10.0a0+git449b176", + "python": "3.12.12", + "platform": "Linux-5.14.21-150400.24.235-default-x86_64-with-glibc2.31", + "onnx": "1.22.0", + "onnxruntime": "1.29.0" + }, + "artifacts": { + "fuse29_step.onnx": { + "bytes": 45081271, + "sha256": "abf72130ad644f7bf2883c39f336536ad839ae7f609cc88d28a5366459e1693c" + }, + "fuse29_seq.onnx": { + "bytes": 45464382, + "sha256": "db040b029538d47b404e9864538fb0c550285081ecce7348ad6fd231fdd7bbcf" + } + } +}