Bind GINO-Greif trilinear adapter, grouped support and CPU cost gates
This commit is contained in:
1 parent
367da00d71
commit
8810276beb
9 files changed
+2229
-15
No files matched your search
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"status": "PASS",
|
||||
"tests": 6,
|
||||
"actual_gpu_queries": 0,
|
||||
"actual_heldout_targets_read": 0,
|
||||
"real_guard": {
|
||||
"idle": {
|
||||
"status": "COMPLETE",
|
||||
"trigger": null,
|
||||
"launches": 1,
|
||||
"samples": 5,
|
||||
"synthetic_gpu_elapsed": 20.0,
|
||||
"lifecycle": [
|
||||
{
|
||||
"event": "leader_reaped",
|
||||
"pid": 50
|
||||
}
|
||||
]
|
||||
},
|
||||
"busy": {
|
||||
"status": "STOPPED",
|
||||
"trigger": "IDLE_DEADLINE",
|
||||
"launches": 0,
|
||||
"samples": 7,
|
||||
"synthetic_gpu_elapsed": 59.99995064700488,
|
||||
"lifecycle": []
|
||||
}
|
||||
},
|
||||
"candidate_sha256": "01d6581c33a6c26d1965acb13248bdb741de892e5929fff08a7e4af431f00d0b",
|
||||
"log_sha256": "c5c85f7fd8f631f3d97a2507e754bb940ebfd88dd300e5871f91ef52bbe8ac9c"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
test_all_19_columns_contribute_and_mass_is_preserved (test_track_b_gino_greif_adapter.GreifAdapter) ... ok
|
||||
test_exact_gather_on_affine_field_and_isotropic_translation (test_track_b_gino_greif_adapter.GreifAdapter) ... ok
|
||||
test_pinned_model_full_64_cpu_forward_and_small_backward (test_track_b_gino_greif_adapter.GreifAdapter) ... ok
|
||||
test_real_production_guard_idle_and_busy_with_frozen_limits (test_track_b_gino_greif_adapter.GreifAdapter) ... ok
|
||||
test_release_gate_requires_both_full_folds_and_respects_phase_cap (test_track_b_gino_greif_adapter.GreifAdapter) ... ok
|
||||
test_source_columns_and_h2_paired_domain (test_track_b_gino_greif_adapter.GreifAdapter) ... ok
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Ran 6 tests in 7.852s
|
||||
|
||||
OK
|
||||
+400
@@ -0,0 +1,400 @@
|
||||
{
|
||||
"status": "PASS",
|
||||
"candidate_sha256": "01d6581c33a6c26d1965acb13248bdb741de892e5929fff08a7e4af431f00d0b",
|
||||
"size": 64,
|
||||
"columns": [
|
||||
"Vf",
|
||||
"grad_Vf_x",
|
||||
"grad_Vf_y",
|
||||
"grad_Vf_z",
|
||||
"Di_star",
|
||||
"grad_Di_x",
|
||||
"grad_Di_y",
|
||||
"grad_Di_z",
|
||||
"Dw",
|
||||
"Dw_star",
|
||||
"grad_Dw_x",
|
||||
"grad_Dw_y",
|
||||
"grad_Dw_z",
|
||||
"Sxx",
|
||||
"Sxy",
|
||||
"Sxz",
|
||||
"Syy",
|
||||
"Syz",
|
||||
"Szz"
|
||||
],
|
||||
"cases": 10,
|
||||
"selection": "minimum, median and maximum node counts within each fold learning and test role, deduplicated",
|
||||
"actual_heldout_labels_read": 0,
|
||||
"actual_gpu_queries": 0,
|
||||
"rows": [
|
||||
{
|
||||
"case": "00001260_a4715d363f88400c8f0238d1_step_003",
|
||||
"examined_roles": [
|
||||
[
|
||||
"0",
|
||||
"learning"
|
||||
]
|
||||
],
|
||||
"original_nodes": 4607,
|
||||
"occupied_cells": 992,
|
||||
"mass_relative_error": 3.282866600784473e-08,
|
||||
"field_integral_relative_error": 1.9138960638542812e-08,
|
||||
"untrained_round_trip_rms_by_column": [
|
||||
0.012181920130182622,
|
||||
0.20778504044559948,
|
||||
0.2327023463522356,
|
||||
0.23170858359936164,
|
||||
0.0010788459549530731,
|
||||
0.03187651449235634,
|
||||
0.04377584893315579,
|
||||
0.0297771006373335,
|
||||
0.612074255830762,
|
||||
0.20573275677258365,
|
||||
0.06122609498221276,
|
||||
0.30326044204725267,
|
||||
0.30165311297492997,
|
||||
0.032666971947694655,
|
||||
0.010767084405423706,
|
||||
0.010653213017495286,
|
||||
0.03512714296319977,
|
||||
0.028874371597121463,
|
||||
0.035157049499953755
|
||||
],
|
||||
"geometry_sha256": "0de3a1e55304b32edab34f9d16880174ff492a59ef07cbc0f2b7e9a2fc3e3f48",
|
||||
"feature_sha256": "63c415a625e17718631dff5b0b2438f29ca90cfd135a66957a76485a6278a267"
|
||||
},
|
||||
{
|
||||
"case": "00001035_be3ed2c9696e4e6a91b34f79_step_000",
|
||||
"examined_roles": [
|
||||
[
|
||||
"0",
|
||||
"learning"
|
||||
]
|
||||
],
|
||||
"original_nodes": 24555,
|
||||
"occupied_cells": 3300,
|
||||
"mass_relative_error": 6.210764347258646e-09,
|
||||
"field_integral_relative_error": 1.1759027751523377e-08,
|
||||
"untrained_round_trip_rms_by_column": [
|
||||
0.017006575172882316,
|
||||
0.3065902866562386,
|
||||
0.3198204005720839,
|
||||
0.240235406513804,
|
||||
0.0019475378893658458,
|
||||
0.05395154827148089,
|
||||
0.08329137009432094,
|
||||
0.057646752461988464,
|
||||
0.5005861658721447,
|
||||
0.12391873674265638,
|
||||
0.37415606123246015,
|
||||
0.42857116054138955,
|
||||
0.3108087109291211,
|
||||
0.01144425870648485,
|
||||
0.0072084227296238595,
|
||||
0.008400424535362447,
|
||||
0.013577797144248286,
|
||||
0.010257794783640743,
|
||||
0.012969572117503794
|
||||
],
|
||||
"geometry_sha256": "66a0b48848a6788ae90717e8ff01ff323d96528509f867a877d4d984a69b636b",
|
||||
"feature_sha256": "e5fb94b8fdf2f2187c852784f531df9a2aada3e127cff3921a5f6d77b95936ad"
|
||||
},
|
||||
{
|
||||
"case": "00000531_bc0d6937206b43bc96521413_step_003",
|
||||
"examined_roles": [
|
||||
[
|
||||
"0",
|
||||
"learning"
|
||||
],
|
||||
[
|
||||
"1",
|
||||
"learning"
|
||||
]
|
||||
],
|
||||
"original_nodes": 87592,
|
||||
"occupied_cells": 5041,
|
||||
"mass_relative_error": 8.159072106828091e-08,
|
||||
"field_integral_relative_error": 8.280059617160237e-08,
|
||||
"untrained_round_trip_rms_by_column": [
|
||||
0.012150151171998247,
|
||||
0.5950299358543687,
|
||||
0.32820018599579887,
|
||||
0.33029959307354756,
|
||||
0.010709930855079895,
|
||||
0.10117405265437704,
|
||||
0.0854855608711231,
|
||||
0.0808491199573961,
|
||||
0.894772539916545,
|
||||
0.2375597327454692,
|
||||
0.667641547587105,
|
||||
0.33434425520488614,
|
||||
0.3405384441496608,
|
||||
0.035844647775055256,
|
||||
0.02985879617562259,
|
||||
0.029935774925938765,
|
||||
0.03334802352904114,
|
||||
0.028101604426083806,
|
||||
0.03372796579234281
|
||||
],
|
||||
"geometry_sha256": "e51bb0752152815bee808bdd093a05578569c2e2292579eda48f1db1986bc3a7",
|
||||
"feature_sha256": "18b2bd1d9778203fba303008a3e28b6f90b44dc8e245d6d230ad4eb50a808959"
|
||||
},
|
||||
{
|
||||
"case": "00000850_2c1efcc32d094e9fb9e1a88e_step_010",
|
||||
"examined_roles": [
|
||||
[
|
||||
"0",
|
||||
"test"
|
||||
],
|
||||
[
|
||||
"1",
|
||||
"learning"
|
||||
]
|
||||
],
|
||||
"original_nodes": 3606,
|
||||
"occupied_cells": 992,
|
||||
"mass_relative_error": 6.83739926898852e-08,
|
||||
"field_integral_relative_error": 7.446604901358558e-08,
|
||||
"untrained_round_trip_rms_by_column": [
|
||||
0.013296326770392103,
|
||||
0.402833112270989,
|
||||
0.2019039543686978,
|
||||
0.22840001166342128,
|
||||
0.0018502403300646843,
|
||||
0.0488678340041665,
|
||||
0.04675443191885937,
|
||||
0.033513513050000276,
|
||||
0.7733650541075195,
|
||||
0.24357965516290306,
|
||||
0.5219534354114654,
|
||||
0.307080956094165,
|
||||
0.08234181775898403,
|
||||
0.021582094285508998,
|
||||
0.026747384886198235,
|
||||
0.010787088215764793,
|
||||
0.028002721272886475,
|
||||
0.008878798222047578,
|
||||
0.02765033831729733
|
||||
],
|
||||
"geometry_sha256": "b19d8e96020943199d0a04a6a1199f0e87840628cae48274886f27b9415e3656",
|
||||
"feature_sha256": "b6084caace3acce6175513d47fdbe2ced5bad29f96c84543059e3971d7a58b20"
|
||||
},
|
||||
{
|
||||
"case": "00000542_4b1756f6e72b45c29a8e4eb4_step_000",
|
||||
"examined_roles": [
|
||||
[
|
||||
"0",
|
||||
"test"
|
||||
]
|
||||
],
|
||||
"original_nodes": 21279,
|
||||
"occupied_cells": 4790,
|
||||
"mass_relative_error": 1.2307863084259907e-07,
|
||||
"field_integral_relative_error": 1.1700198898623171e-07,
|
||||
"untrained_round_trip_rms_by_column": [
|
||||
0.00811254674788689,
|
||||
0.2216123931353501,
|
||||
0.2816900326785363,
|
||||
0.17656248119332907,
|
||||
0.0011262324971348648,
|
||||
0.046287966082074916,
|
||||
0.0453399958267896,
|
||||
0.05162672293591287,
|
||||
0.4711985098941484,
|
||||
0.18723517785500757,
|
||||
0.29016290862300864,
|
||||
0.4229963572737481,
|
||||
0.16468370242145883,
|
||||
0.017773491570711612,
|
||||
0.014041918201626117,
|
||||
0.004508497046601373,
|
||||
0.018632529031247062,
|
||||
0.011212140302554028,
|
||||
0.017834653160982917
|
||||
],
|
||||
"geometry_sha256": "ea4d042fd092a324fa60ef7d145222c14d36a7a234676ad059381f85c34191f6",
|
||||
"feature_sha256": "dc30e37c3d151ebf3d137c7be3ccf94512527b86363eed238346d6f756dca6bf"
|
||||
},
|
||||
{
|
||||
"case": "00000220_5324c79b172f41e8a49afc6f_step_007",
|
||||
"examined_roles": [
|
||||
[
|
||||
"0",
|
||||
"test"
|
||||
]
|
||||
],
|
||||
"original_nodes": 95204,
|
||||
"occupied_cells": 48135,
|
||||
"mass_relative_error": 7.658990364145524e-08,
|
||||
"field_integral_relative_error": 4.754544757901158e-08,
|
||||
"untrained_round_trip_rms_by_column": [
|
||||
0.014653378193370318,
|
||||
0.21328407019776582,
|
||||
0.19313401838030167,
|
||||
0.17027123206510766,
|
||||
0.0018824141068123584,
|
||||
0.031554435452555055,
|
||||
0.03985646496971004,
|
||||
0.03576688540377705,
|
||||
0.12931333533021824,
|
||||
0.03343954698632402,
|
||||
0.30112966641041045,
|
||||
0.29524168834567294,
|
||||
0.22132269751713443,
|
||||
0.003850742969128259,
|
||||
0.0026817240623342327,
|
||||
0.002671107408575845,
|
||||
0.003814908634874775,
|
||||
0.002764038155529796,
|
||||
0.003855423620458215
|
||||
],
|
||||
"geometry_sha256": "14c24ea22773c023fad4f0dd499e76788e43203fe89b444ddb4ee5bd3701f00b",
|
||||
"feature_sha256": "a0db3619f283558f224bc5aed986c61bfd83b20bea92a4c98527ed58c2b00303"
|
||||
},
|
||||
{
|
||||
"case": "00001000_6962bc8aad2c4e27b046d5b4_step_002",
|
||||
"examined_roles": [
|
||||
[
|
||||
"1",
|
||||
"learning"
|
||||
]
|
||||
],
|
||||
"original_nodes": 23833,
|
||||
"occupied_cells": 20826,
|
||||
"mass_relative_error": 1.548957584418531e-08,
|
||||
"field_integral_relative_error": 1.4353874761559983e-08,
|
||||
"untrained_round_trip_rms_by_column": [
|
||||
0.016885322698187953,
|
||||
0.09466350005781704,
|
||||
0.08879479171272191,
|
||||
0.11683447030431629,
|
||||
0.0018563276302570465,
|
||||
0.017056889213347366,
|
||||
0.016655010252748955,
|
||||
0.012774000087506765,
|
||||
0.33800471454698106,
|
||||
0.10645817840533135,
|
||||
0.11477653746749793,
|
||||
0.11908635922973464,
|
||||
0.29557531598017556,
|
||||
0.005399038973402256,
|
||||
0.0011068414582585924,
|
||||
0.0032831638730655343,
|
||||
0.005328885004338559,
|
||||
0.0034872679512362283,
|
||||
0.00972982219057007
|
||||
],
|
||||
"geometry_sha256": "73606586f9f66d7b0fdfbf439cb4bb64430f8751ec0ea50af8a9a56c1a72001d",
|
||||
"feature_sha256": "6d82265b68d6c5d3283635e83ed1be849b8d4f8d5c8d1046cd3dbb8c5a6a41fc"
|
||||
},
|
||||
{
|
||||
"case": "00001170_0889c458f3f74dc288d2d531_step_001",
|
||||
"examined_roles": [
|
||||
[
|
||||
"1",
|
||||
"test"
|
||||
]
|
||||
],
|
||||
"original_nodes": 6459,
|
||||
"occupied_cells": 2266,
|
||||
"mass_relative_error": 5.9161202159430104e-08,
|
||||
"field_integral_relative_error": 6.018970428460765e-08,
|
||||
"untrained_round_trip_rms_by_column": [
|
||||
0.016572325424080034,
|
||||
0.33464309759966165,
|
||||
0.22524167469187853,
|
||||
0.13258314600322627,
|
||||
0.0020459887099878236,
|
||||
0.0348391901079251,
|
||||
0.02315110753380344,
|
||||
0.028655162426819307,
|
||||
2.2198961067446126,
|
||||
0.24665512276554982,
|
||||
0.5204210855403673,
|
||||
0.07023047109576014,
|
||||
0.19266217971948213,
|
||||
0.01327369395158276,
|
||||
0.007800910654381866,
|
||||
0.01677077023456838,
|
||||
0.012068632329104996,
|
||||
0.0031309932884021692,
|
||||
0.011511704984698128
|
||||
],
|
||||
"geometry_sha256": "f2a4d80c3a6b9753c9dd3cb5edb1e5b54b742fe260151401ddbea3642a235046",
|
||||
"feature_sha256": "e85dcb0501828c05df104844135e6dc803ff904962eb8582451f783d50e349a1"
|
||||
},
|
||||
{
|
||||
"case": "00000346_4185972a944744d8a7a0f2b4_step_002",
|
||||
"examined_roles": [
|
||||
[
|
||||
"1",
|
||||
"test"
|
||||
]
|
||||
],
|
||||
"original_nodes": 25649,
|
||||
"occupied_cells": 13091,
|
||||
"mass_relative_error": 4.6199633008114915e-09,
|
||||
"field_integral_relative_error": 7.050818722224138e-09,
|
||||
"untrained_round_trip_rms_by_column": [
|
||||
0.01965389192606262,
|
||||
0.1365592934250816,
|
||||
0.15015376793911245,
|
||||
0.20715787371215333,
|
||||
0.0019797766744109333,
|
||||
0.028368599716543912,
|
||||
0.031715518813888004,
|
||||
0.045005095755684545,
|
||||
0.29321420389261316,
|
||||
0.06156776327988507,
|
||||
0.1665945591891908,
|
||||
0.2160313090344996,
|
||||
0.3070727273749295,
|
||||
0.007554872371547377,
|
||||
0.003991344539569549,
|
||||
0.004794203664292648,
|
||||
0.007654506206917486,
|
||||
0.0048604490862770066,
|
||||
0.011239339537851108
|
||||
],
|
||||
"geometry_sha256": "4ff845dd592a04f270fab1bda44a08340e6fd1df32f0498968c766fa4003a863",
|
||||
"feature_sha256": "045712564f58a09ea4109088019f8fb923c0b2469a642fcc9821f0033e019d47"
|
||||
},
|
||||
{
|
||||
"case": "00001233_73b40f9a4cd3419ab3b42b73_step_002",
|
||||
"examined_roles": [
|
||||
[
|
||||
"1",
|
||||
"test"
|
||||
]
|
||||
],
|
||||
"original_nodes": 71745,
|
||||
"occupied_cells": 21104,
|
||||
"mass_relative_error": 5.478776077261216e-08,
|
||||
"field_integral_relative_error": 2.714807884052206e-08,
|
||||
"untrained_round_trip_rms_by_column": [
|
||||
0.023468184495989298,
|
||||
0.3587495799392281,
|
||||
0.4068047276329182,
|
||||
0.5498843338052568,
|
||||
0.02522047648497152,
|
||||
0.04217476611123329,
|
||||
0.09465735155499498,
|
||||
0.07353732881200965,
|
||||
0.23019340472968636,
|
||||
0.21898849251003236,
|
||||
0.4355562675178718,
|
||||
0.43176241442373037,
|
||||
0.6790013848085569,
|
||||
0.028766116838738084,
|
||||
0.0054419769159342,
|
||||
0.005658482719817048,
|
||||
0.019373973418610788,
|
||||
0.00958208804835933,
|
||||
0.027796016931771934
|
||||
],
|
||||
"geometry_sha256": "20db0aec73b512e9744601468ed7d79ff6879f45061998cd3ad880c1d5a1f83d",
|
||||
"feature_sha256": "f9b91d33cf0b5b8817b0066a2ff5acfad67288e8045de8253f3b0e67c2324abd"
|
||||
}
|
||||
]
|
||||
}
|
||||
+1355
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,19 @@
|
||||
# GINO-Greif 适配器 CPU 审阅包
|
||||
|
||||
按 h-1789ca7e 在原准备根下固定适配器、比较域、CPU 回放和预算门。此包供适配器和协议审阅。正式训练、预测和留出保管执行入口仍需组合固定,真实首轮计时和派发须有对应授权。 [Claude 裁定](https://arcticnimbus.slack.com/archives/C0C78UFKGRM/p1795086316785579) · [适配器与协议绑定](../artifacts/track-b-gino-greif-preparation-2026-11-19/adapter-review/preparation-binding.json)
|
||||
|
||||
## 从原节点到网格再回原节点
|
||||
|
||||
原样保留 H2 的 19 列顺序。随未来训练入口复用原折 learning 全节点的标准化,原 FP64 `Vf` 与本折冻结 `c` 继续用于残差监督及秒数解码。每件原节点按 raw ID 进入带一格边距的等比例包围立方体,经三线性权重与原节点体积质量沉积到 64³ 网格。每个格点保存 19 列质量加权均值和一位占用掩码。空格点清零。Tucker FNO 宽 32、三向各 24 模。用同一八角模板插回原节点,与原 19 列拼接后读出逐节点填充残差。 [实现](../tools/track_b_gino_greif_adapter.py)
|
||||
|
||||
空间转移保留沉积质量和 19 列质量加权积分。入格混合通常不可逆,模型读出因此保留原节点列。公共 Fourier 网格可以跨原图物理分量传递信息,也可能平滑小于网格的薄隙。这是与 H2 的模型差异,不能用这项比较单独判断真实连通是否有益。 [几何回执](../artifacts/track-b-gino-greif-preparation-2026-11-19/adapter-review/geometry-audit.json)
|
||||
|
||||
真实输入按每折学习和测试各选择节点数最小、中位、最大件后去重,共 10 件、364,529 原节点。只读原坐标、raw ID、质量和 19 列。全节点均可往返,最大质量误差 1.24e−7,最大归一化列积分误差 1.18e−7。另做了 64³ 合成 CPU 前向、小网格非零反向、线性场插值及实守卫的空卡和忙卡模拟。六项检查均通过,压力和 Fill_time 目标、实际 GPU 查询及实际训练均为零。 [CPU 回放](../artifacts/track-b-gino-greif-preparation-2026-11-19/adapter-review/cpu-replay.json)
|
||||
|
||||
## 比较域与成本门
|
||||
|
||||
分组折 0、1 各使用 seed 0、1 和原 H2 的 200 轮日程。每折的 learning、validation、test 角色按原家族组件完全隔离,并分别覆盖 320/111/121 件、374/87/91 件。核对了 H2 两种子的冻结预测清单,同折两臂使用相同 212 件测试件、78 个家族组件、原节点顺序和 PPS 查询支持。计划在四份模型和全节点预测均冻结后统一保管评分,复用原时场相对 L2、末点距离/Rg 和 Kendall τ-b。 [适配器与协议绑定](../artifacts/track-b-gino-greif-preparation-2026-11-19/adapter-review/preparation-binding.json)
|
||||
|
||||
Phase 3 已结算锚点 415,212.151643 GPU 秒,原 GINO 测量 222.805002 秒单列一次,GINO ShapeNet 与 H2-P 各按未结算满帽 40,000 秒保留。合计 495,434.956645 / 720,000 GPU 秒。224,565.043355 GPU 秒(62.38 小时)是扣除其他可能未结算预约之前的余量上界。派发时须重新对账并固定本项明确分配,CPU 回放只验证计算公式。 [实际 H2-P 阶段账](../artifacts/track-b-h2-pressure-combined-2026-11-19/stage-authorization.json)
|
||||
|
||||
两折 seed 0 的首轮必须分别覆盖完整 learning 支持,分别为 8,742,060 与 9,731,293 节点。两个首轮的已耗与设置只记一次。其余每折 399 轮按该折实测轮时加 25% 投影,再计剩余等待、设置、预测、评分及收尾。缺任一实测保持 HOLD,超本项额度或全阶段剩余额度即停止。实测与其他未结算预约仍为空,正式成本门未判定。 [预算门实现](../tools/track_b_gino_greif_prepare.py)
|
||||
@@ -0,0 +1,109 @@
|
||||
"""CPU geometry, pinned spectral implementation and production guard replay."""
|
||||
|
||||
import ast
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
import test_track_b_followup_preparation as followup
|
||||
import track_b_gino_greif_prepare as prep
|
||||
from track_b_gino_greif_adapter import COLUMNS, GRID, GreifGINO, deposit, gather, stencil
|
||||
from track_b_gino_shapenet_entry import read, sha
|
||||
|
||||
|
||||
class GreifAdapter(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
torch.set_num_threads(1)
|
||||
cls.candidate = read(prep.REVIEW_ROOT/'preparation-binding.json')
|
||||
if cls.candidate != prep.binding():
|
||||
raise ValueError('Candidate differs from the exact on-disk binding')
|
||||
|
||||
def test_all_19_columns_contribute_and_mass_is_preserved(self):
|
||||
ids, weights = stencil([[0.,0.,0.],[.12,.29,.35],[.2,.41,.46],[1.,1.,1.]], [1,4,8,21], 8)
|
||||
mass = torch.tensor([.1,1.,2.,3.], dtype=torch.float32)
|
||||
x = torch.arange(76, dtype=torch.float32).reshape(4,19) / 11
|
||||
grid, volume = deposit(x, mass, ids, weights, 8)
|
||||
self.assertEqual(grid.shape, (20,8,8,8))
|
||||
self.assertTrue(torch.allclose(volume.sum(), torch.tensor(1.)))
|
||||
expected = (mass/mass.sum()) @ x
|
||||
self.assertTrue(torch.allclose(grid[:19].reshape(19,-1) @ volume, expected))
|
||||
self.assertTrue(torch.equal(grid[-1].reshape(-1).bool(), volume>0))
|
||||
self.assertFalse(bool(torch.any(grid[:19].reshape(19,-1)[:, volume==0])))
|
||||
# At the outer corner distinct from others, all channels round trip exactly.
|
||||
self.assertTrue(torch.allclose(gather(grid[:19], ids, weights)[0], x[0]))
|
||||
|
||||
def test_exact_gather_on_affine_field_and_isotropic_translation(self):
|
||||
xyz = np.array([[0.,0.,0.],[.23,.6,.4],[1.,.7,.8]])
|
||||
ids = [23,25,58]
|
||||
corners, weights = stencil(xyz, ids, 8)
|
||||
c2, w2 = stencil(xyz + np.array([2.,-4.,3.]), ids, 8)
|
||||
self.assertTrue(torch.equal(c2,corners))
|
||||
self.assertTrue(torch.allclose(weights,w2,atol=1e-7))
|
||||
axes = torch.meshgrid(*(torch.arange(8,dtype=torch.float32) for _ in range(3)),indexing='ij')
|
||||
full = (3*axes[0] + 2*axes[1] - axes[2] + 10)[None]
|
||||
lattice = (xyz - (xyz.min(0)+xyz.max(0))/2)*5 + 3.5
|
||||
expected = torch.from_numpy(lattice @ np.array([3,2,-1]) + 10).float()
|
||||
self.assertTrue(torch.allclose(gather(full,corners,weights)[:,0],expected))
|
||||
with self.assertRaises(ValueError):
|
||||
stencil(xyz, [23,58,25], 8)
|
||||
|
||||
def test_pinned_model_full_64_cpu_forward_and_small_backward(self):
|
||||
xyz = [[0.,0.,0.],[.12,.29,.35],[.2,.41,.46],[1.,1.,1.]]
|
||||
raw = [2,4,8,12]
|
||||
x = torch.arange(76, dtype=torch.float32).reshape(4,19) / 100
|
||||
mass = torch.ones(4)
|
||||
with torch.no_grad():
|
||||
v, w = stencil(xyz, raw)
|
||||
core = GreifGINO().eval()
|
||||
y = core(x,mass,v,w)
|
||||
self.assertEqual(y.shape, (4,))
|
||||
self.assertTrue(torch.equal(y,torch.zeros(4)))
|
||||
self.assertEqual(core.size, GRID)
|
||||
v, w = stencil(xyz, raw, 8)
|
||||
core = GreifGINO(size=8,modes=(4,4,4))
|
||||
with torch.no_grad():
|
||||
core.readout[-1].weight.fill_(.01)
|
||||
core(x,mass,v,w).sum().backward()
|
||||
self.assertTrue(any(p.grad is not None and p.grad.abs().sum() > 0 for p in core.fno.parameters()))
|
||||
|
||||
def test_source_columns_and_h2_paired_domain(self):
|
||||
pilot = prep.read(prep.PILOT)
|
||||
source = Path(__file__).resolve().parents[1] / 'tools/gre24_features_v2.py'
|
||||
layout = next(ast.literal_eval(s.value) for s in ast.parse(source.read_text()).body if
|
||||
isinstance(s, ast.Assign) and any(isinstance(t, ast.Name) and t.id == 'COLUMNS' for t in s.targets))
|
||||
self.assertEqual(layout, COLUMNS)
|
||||
self.assertEqual(self.candidate['adapter_candidate']['columns'], list(layout))
|
||||
self.assertEqual([self.candidate['folds'][k]['counts']['test'] for k in ('0','1')],[121,91])
|
||||
self.assertEqual(self.candidate['h2_reference_support']['status'],'REFERENCE_MANIFESTS_ALIGNED')
|
||||
self.assertEqual(self.candidate['epochs'], pilot['full_epochs'])
|
||||
self.assertFalse(set(self.candidate['folds']['0']['parts']['test']) &
|
||||
set(self.candidate['folds']['1']['parts']['test']))
|
||||
|
||||
def test_real_production_guard_idle_and_busy_with_frozen_limits(self):
|
||||
for busy in (False, True):
|
||||
followup.FollowupPreparation().replay_guard('GINO-Greif', self.candidate, busy)
|
||||
|
||||
def test_release_gate_requires_both_full_folds_and_respects_phase_cap(self):
|
||||
c = self.candidate
|
||||
rows = {f:dict(fold=int(f),seed=0,epoch=1,learning_cases=d['counts']['learning'],
|
||||
learning_nodes=d['learning_nodes'],heldout_target_reads=0,
|
||||
epoch_seconds=50.+5*int(f),booked_gpu_seconds=100.) for f,d in c['folds'].items()}
|
||||
k = dict(other_unsettled=0.,approved_greif_cap=80000.,remaining_overhead=500.)
|
||||
result = prep.first_epoch_gate(c, rows, **k)
|
||||
self.assertTrue(result['release_epoch2'])
|
||||
self.assertEqual(result['charged_first_epochs_and_setup_gpu_seconds'],200.)
|
||||
self.assertEqual(result['remaining_train_gpu_seconds'],399*105.)
|
||||
self.assertFalse(prep.first_epoch_gate(c, {'0':rows['0']}, **k)['release_epoch2'])
|
||||
remainder=c['projection']['upper_remaining_before_other_bookings_gpu_seconds']
|
||||
blocked=prep.first_epoch_gate(c, rows, **dict(k,other_unsettled=remainder-10000))
|
||||
self.assertEqual(blocked['status'],'STOP_PROJECTED_CAP')
|
||||
self.assertFalse(blocked['release_epoch2'])
|
||||
with self.assertRaises(ValueError):
|
||||
prep.first_epoch_gate(c, dict(rows, **{'1':dict(rows['1'],learning_cases=373)}), **k)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,88 @@
|
||||
"""Audit a fixed set of original Greif geometry and immutable input arrays on CPU."""
|
||||
|
||||
import argparse
|
||||
import ast
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
import track_b_gino_greif_prepare as preparation
|
||||
from track_b_gino_greif_adapter import COLUMNS, GRID, deposit, gather, stencil
|
||||
from track_b_gino_shapenet_entry import BASE, checked, read, save, sha
|
||||
|
||||
|
||||
def fixed_cases(pilot, folds):
|
||||
selected = {}
|
||||
for fold, data in folds.items():
|
||||
for role in ('learning', 'test'):
|
||||
cases = sorted(data['parts'][role], key=lambda case: (pilot['parts'][case]['nodes'], case))
|
||||
for index in (0, len(cases) // 2, len(cases)-1):
|
||||
selected.setdefault(cases[index], []).append((fold, role))
|
||||
return selected
|
||||
|
||||
|
||||
def geometry(pilot, case, roles):
|
||||
row = pilot['parts'][case]
|
||||
source = pilot['geometry'][case]
|
||||
with np.load(checked(source['path'], source['sha256']), allow_pickle=False) as archive:
|
||||
points, ids, raw_mass = (archive[name].copy() for name in ('points','raw_ids','mass'))
|
||||
|
||||
def inputs(name):
|
||||
path = BASE / row['output'] / name
|
||||
return np.load(checked(path, row['output_sha256'][name]), allow_pickle=False)
|
||||
|
||||
if len(ids) != row['nodes'] or not np.array_equal(ids, inputs('raw_ids.npy')) or not np.array_equal(raw_mass, inputs('mass.npy')):
|
||||
raise ValueError('Frozen original node/mass identity differs for ' + case)
|
||||
x = torch.from_numpy(np.asarray(inputs('features.npy'), dtype=np.float32))
|
||||
mass = torch.from_numpy(raw_mass.astype(np.float32))
|
||||
corner, weight = stencil(points, ids)
|
||||
grid, cell_mass = deposit(x, mass, corner, weight)
|
||||
reopened = gather(grid[:len(COLUMNS)], corner, weight)
|
||||
if reopened.shape != x.shape or not bool(torch.isfinite(reopened).all()):
|
||||
raise ValueError('Grid readout does not cover all original nodes')
|
||||
if (weight.sum(1) - 1.).abs().max().item() > 2e-7:
|
||||
raise ValueError('Incomplete trilinear node weights')
|
||||
ref_mass = mass.double() / mass.double().sum()
|
||||
source_integral = ref_mass @ x.double()
|
||||
scale = (ref_mass @ x.double().abs()).clamp_min(1.)
|
||||
grid_integral = grid[:len(COLUMNS)].reshape(len(COLUMNS),-1).double() @ cell_mass.double()
|
||||
relative_integral_error = ((source_integral-grid_integral).abs()/scale).max().item()
|
||||
relative_mass_error = abs(cell_mass.double().sum().item()-1.)
|
||||
if relative_mass_error > 2e-5 or relative_integral_error > 2e-5:
|
||||
raise ValueError('Mass-weighted transfer failed the numerical preflight')
|
||||
error = (reopened - x).double()
|
||||
column_rms = (ref_mass @ error.square()).sqrt().tolist()
|
||||
return dict(case=case, examined_roles=roles, original_nodes=len(ids), occupied_cells=int((cell_mass>0).sum()),
|
||||
mass_relative_error=relative_mass_error, field_integral_relative_error=relative_integral_error,
|
||||
untrained_round_trip_rms_by_column=column_rms,
|
||||
geometry_sha256=source['sha256'], feature_sha256=row['output_sha256']['features.npy'])
|
||||
|
||||
|
||||
def audit():
|
||||
if os.environ.get('CUDA_VISIBLE_DEVICES') != '':
|
||||
raise PermissionError('Geometry preparation requires CUDA hidden')
|
||||
torch.set_num_threads(1)
|
||||
root = preparation.REVIEW_ROOT
|
||||
candidate = read(root/'preparation-binding.json')
|
||||
if candidate != preparation.binding() or (root/'geometry-audit.json').exists():
|
||||
raise PermissionError('Only the new frozen preparation candidate')
|
||||
source = Path(__file__).with_name('gre24_features_v2.py')
|
||||
columns = next(ast.literal_eval(stmt.value) for stmt in ast.parse(source.read_text()).body
|
||||
if isinstance(stmt, ast.Assign) and any(isinstance(x, ast.Name) and x.id == 'COLUMNS' for x in stmt.targets))
|
||||
if columns != COLUMNS:
|
||||
raise ValueError('Original 19-column layout differs')
|
||||
pilot = read(checked(preparation.PILOT, preparation.PINS[str(preparation.PILOT)]))
|
||||
cases = fixed_cases(pilot, candidate['folds'])
|
||||
rows = [geometry(pilot, case, scope) for case, scope in cases.items()]
|
||||
save(root/'geometry-audit.json', dict(status='PASS', candidate_sha256=sha(root/'preparation-binding.json'),
|
||||
size=GRID, columns=list(COLUMNS), cases=len(rows),
|
||||
selection='minimum, median and maximum node counts within each fold learning and test role, deduplicated',
|
||||
actual_heldout_labels_read=0, actual_gpu_queries=0, rows=rows))
|
||||
print(len(rows), sum(r['original_nodes'] for r in rows))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
argparse.ArgumentParser(description=__doc__).parse_args()
|
||||
audit()
|
||||
@@ -0,0 +1,100 @@
|
||||
"""Greif node-to-grid integral, Tucker FNO, and grid-to-original-node readout."""
|
||||
|
||||
from itertools import product
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
from torch import nn
|
||||
|
||||
|
||||
GRID = 64
|
||||
WIDTH = 32
|
||||
MODES = (24, 24, 24)
|
||||
COLUMNS = ('Vf', 'grad_Vf_x', 'grad_Vf_y', 'grad_Vf_z', 'Di_star',
|
||||
'grad_Di_x', 'grad_Di_y', 'grad_Di_z', 'Dw', 'Dw_star',
|
||||
'grad_Dw_x', 'grad_Dw_y', 'grad_Dw_z', 'Sxx', 'Sxy', 'Sxz', 'Syy', 'Syz', 'Szz')
|
||||
CHUNK = 8192
|
||||
|
||||
|
||||
def stencil(points, raw_ids, size=GRID):
|
||||
"""An isotropic part cube with one lattice cell of margin on each face."""
|
||||
xyz = np.asarray(points, dtype=np.float64)
|
||||
ids = np.asarray(raw_ids)
|
||||
if (size < 5 or xyz.ndim != 2 or xyz.shape[1] != 3 or len(xyz) < 2
|
||||
or not np.isfinite(xyz).all() or ids.shape != (len(xyz),)
|
||||
or ids.dtype.kind not in 'iu' or not np.all(ids[1:] > ids[:-1])):
|
||||
raise ValueError('Original coordinates and strictly ordered raw node IDs required')
|
||||
low, high = xyz.min(axis=0), xyz.max(axis=0)
|
||||
side = (high - low).max()
|
||||
if not np.isfinite(side) or side <= 0:
|
||||
raise ValueError('Invalid bounding cube')
|
||||
lattice = (xyz - (low + high) / 2) / side * (size - 3) + (size - 1) / 2
|
||||
if not np.isfinite(lattice).all() or lattice.min() < .999999 or lattice.max() > size - 1.999999:
|
||||
raise ValueError('Node outside fixed interpolation cube')
|
||||
base = np.floor(lattice).astype(np.int64)
|
||||
frac = lattice - base
|
||||
vertices, weights = [], []
|
||||
for bits in product((0, 1), repeat=3):
|
||||
corners = base + np.asarray(bits)
|
||||
vertices.append(np.ravel_multi_index(corners.T, (size, size, size)))
|
||||
weights.append(np.prod(np.where(bits, frac, 1 - frac), axis=1))
|
||||
return (torch.from_numpy(np.stack(vertices, axis=1)),
|
||||
torch.from_numpy(np.stack(weights, axis=1).astype(np.float32)))
|
||||
|
||||
|
||||
def deposit(features, mass, vertices, weights, size=GRID):
|
||||
if (features.ndim != 2 or features.shape[1] != len(COLUMNS) or mass.shape != features.shape[:1]
|
||||
or vertices.shape != (len(mass), 8) or weights.shape != vertices.shape
|
||||
or mass.dtype != torch.float32 or features.dtype != torch.float32 or weights.dtype != torch.float32
|
||||
or vertices.dtype != torch.int64 or not torch.isfinite(features).all()
|
||||
or not torch.isfinite(mass).all() or torch.any(mass <= 0)):
|
||||
raise ValueError('Expected full original FP32 features, positive mass and reviewed stencil')
|
||||
total = mass.sum()
|
||||
if not torch.isfinite(total) or total <= 0:
|
||||
raise ValueError('Invalid total nodal mass')
|
||||
volume = mass / total
|
||||
cells = size**3
|
||||
numerator = features.new_zeros((cells, len(COLUMNS)))
|
||||
denominator = features.new_zeros(cells)
|
||||
# Keep the (nodes × 8 × channels) product out of memory.
|
||||
for corner in range(8):
|
||||
ids = vertices[:, corner]
|
||||
weighted_mass = volume * weights[:, corner]
|
||||
denominator.index_add_(0, ids, weighted_mass)
|
||||
numerator.index_add_(0, ids, weighted_mass[:, None] * features)
|
||||
occupied = denominator > 0
|
||||
field = numerator / torch.where(occupied, denominator, 1.)[:, None]
|
||||
grid = torch.cat((field, occupied[:, None].to(field.dtype)), dim=1)
|
||||
return grid.T.reshape(len(COLUMNS) + 1, size, size, size), denominator
|
||||
|
||||
|
||||
def gather(grid, vertices, weights):
|
||||
channels = grid.shape[0]
|
||||
values = grid.reshape(channels, -1).T
|
||||
return torch.cat([
|
||||
(values[vertices[lo:lo + CHUNK]] * weights[lo:lo + CHUNK, :, None]).sum(1)
|
||||
for lo in range(0, len(vertices), CHUNK)
|
||||
])
|
||||
|
||||
|
||||
class GreifGINO(nn.Module):
|
||||
"""Fixed trilinear integral layers around the pinned GINO-family spectral core."""
|
||||
|
||||
def __init__(self, size=GRID, modes=MODES):
|
||||
super().__init__()
|
||||
from neuralop.models import FNO
|
||||
|
||||
self.size = size
|
||||
self.fno = FNO(list(modes), hidden_channels=WIDTH, in_channels=len(COLUMNS) + 1,
|
||||
out_channels=WIDTH, norm='group_norm', use_mlp=True,
|
||||
mlp={'expansion': 1., 'dropout': 0.}, domain_padding=.125,
|
||||
factorization='tucker', rank=.4)
|
||||
self.readout = nn.Sequential(nn.Linear(WIDTH + len(COLUMNS), 64), nn.GELU(), nn.Linear(64, 1))
|
||||
nn.init.zeros_(self.readout[-1].weight)
|
||||
nn.init.zeros_(self.readout[-1].bias)
|
||||
|
||||
def forward(self, features, mass, vertices, weights):
|
||||
grid, _ = deposit(features, mass, vertices, weights, self.size)
|
||||
latent = self.fno(grid[None])[0]
|
||||
at_nodes = gather(latent, vertices, weights)
|
||||
return self.readout(torch.cat((at_nodes, features), dim=1))[:, 0]
|
||||
@@ -10,9 +10,13 @@ from track_b_gino_shapenet_entry import BASE, checked, read, save, sha
|
||||
|
||||
|
||||
ROOT = BASE / 'artifacts/track-b-gino-greif-preparation-2026-11-19'
|
||||
STATUS = 'PREPARED_PENDING_ADAPTER_REVIEW_TIMING_AND_PHASE_PROJECTION'
|
||||
REVIEW_ROOT = ROOT / 'adapter-review'
|
||||
STATUS = 'CPU_ADAPTER_READY_PENDING_EXECUTION_BINDING_AND_MEASURED_COST'
|
||||
PILOT = BASE / 'artifacts/phase2-h2-pilot-2026-11-17/contract.json'
|
||||
QUERY = Path('/home/frank14f/MeltMind-runs/phase2-h2-s2-postfit-2026-11-17/contract.json')
|
||||
H2_REFERENCE = (QUERY.parent, QUERY.parent.with_name('phase3-seed1-postfit-2026-11-18'))
|
||||
H2_PRESSURE_AUTH = BASE / 'artifacts/track-b-h2-pressure-combined-2026-11-19/stage-authorization.json'
|
||||
H2_PRESSURE_AUTH_SHA = '42ef5913159cb0b2320f1ff1fb4fe5c2460d98fa51b240974ed662c4b7c84d0a'
|
||||
PHASE_TERMINAL = BASE / 'artifacts/phase3-item1b-fold0-labelled-recovery-2026-11-19/complete.json'
|
||||
PINS = {
|
||||
str(PILOT): '9f616974fb01f8f5cab6233273d541b3e53f5975f3632db45ab4676f911fba7b',
|
||||
@@ -21,6 +25,7 @@ PINS = {
|
||||
}
|
||||
ROLES = ('learning', 'validation', 'test')
|
||||
CAP = 200 * 3600
|
||||
EPOCHS = 200
|
||||
|
||||
|
||||
def grouped_folds(pilot, query):
|
||||
@@ -47,6 +52,8 @@ def grouped_folds(pilot, query):
|
||||
raise ValueError(f'Incomplete frozen support for fold {fold}')
|
||||
fold_records[str(fold)] = dict(counts=sizes, clock_coefficient=data['c'],
|
||||
clock_sha256=data['clock_sha256'],
|
||||
learning_nodes=data['learning_nodes'],
|
||||
family_counts={role: sum(r == role for r in owners.values()) for role in ROLES},
|
||||
parts={role: data[role] for role in ROLES})
|
||||
return fold_records
|
||||
|
||||
@@ -67,34 +74,128 @@ def project(phase_charged, approvals, epoch_seconds_by_fold, epochs, overhead_gp
|
||||
phase_cap_gpu_seconds=CAP, within_phase_cap=phase_total <= CAP)
|
||||
|
||||
|
||||
def paired_support(pilot, query, folds):
|
||||
"""Check the already frozen H2 reference roster without opening prediction or target arrays."""
|
||||
family = {r['case']: r['component_id'] for r in query['rows'] if r['included']}
|
||||
support, manifests, pins = {}, [], {}
|
||||
for root in H2_REFERENCE:
|
||||
manifest_path = root / 'predictions-manifest.json'
|
||||
terminal_path = root / 'complete.json'
|
||||
if read(terminal_path)['status'] != 'COMPLETE':
|
||||
raise ValueError('Both H2 reference postfits must be complete')
|
||||
rows = read(manifest_path)['entries']
|
||||
row_map = {(str(r['fold']), r['case']): r for r in rows}
|
||||
if len(row_map) != len(rows):
|
||||
raise ValueError('Duplicate H2 reference predictions')
|
||||
manifests.append(row_map)
|
||||
pins.update({str(p): sha(p) for p in (manifest_path, terminal_path)})
|
||||
for fold, data in folds.items():
|
||||
for case in data['parts']['test']:
|
||||
r0, r1 = (r[fold, case] for r in manifests)
|
||||
expected = (family[case], pilot['parts'][case]['nodes'])
|
||||
if (any((r['component_id'], r['nodes']) != expected for r in (r0, r1))
|
||||
or r0['query_nodes'] != r1['query_nodes'] or r1['seed0_sha256'] != r0['sha256']
|
||||
or r1['raw_ids_sha256'] != pilot['parts'][case]['output_sha256']['raw_ids.npy']):
|
||||
raise ValueError('H2 paired fold/seed full node or query support differs')
|
||||
support[fold] = dict(cases=len(data['parts']['test']), families=data['family_counts']['test'],
|
||||
references=[0, 1], raw_prediction_or_target_arrays_opened=0)
|
||||
return dict(status='REFERENCE_MANIFESTS_ALIGNED', folds=support, sha256=pins)
|
||||
|
||||
|
||||
def phase_ledger(prior, timing, gino_cap):
|
||||
auth = read(checked(H2_PRESSURE_AUTH, H2_PRESSURE_AUTH_SHA))
|
||||
h2 = auth['phase3_booked']
|
||||
if (h2['anchor_gpu_seconds'] != prior or h2['gino_formal_cap_gpu_seconds'] != gino_cap
|
||||
or h2['gino_historical_measurement_gpu_seconds_once'] != timing['prior_measurement_gpu_seconds']
|
||||
or h2['h2_pressure_formal_cap_gpu_seconds'] != 40000):
|
||||
raise ValueError('Previously adopted phase-3 bookings differ')
|
||||
historic = timing['prior_measurement_gpu_seconds']
|
||||
total = prior + historic + gino_cap + h2['h2_pressure_formal_cap_gpu_seconds']
|
||||
if total != h2['total_gpu_seconds'] or total >= CAP:
|
||||
raise ValueError('Phase-3 published accounting differs')
|
||||
return dict(settled_phase3_through_1b_gpu_seconds=prior,
|
||||
gino_measurement_once_gpu_seconds=historic, gino_shapenet_formal_reserve_gpu_seconds=gino_cap,
|
||||
h2_pressure_unsettled_max_gpu_seconds=40000, accounted_gpu_seconds=total,
|
||||
phase_cap_gpu_seconds=CAP, upper_remaining_before_other_bookings_gpu_seconds=CAP-total,
|
||||
h2_stage_authorization_sha256=H2_PRESSURE_AUTH_SHA,
|
||||
other_unsettled_bookings_gpu_seconds=None, measured_greif_epoch_seconds=None,
|
||||
complete_projection=None, status='HOLD_PENDING_DISPATCH_LEDGER_AND_TWO_MEASURED_EPOCHS')
|
||||
|
||||
|
||||
def first_epoch_gate(candidate, receipts, *, other_unsettled, approved_greif_cap, remaining_overhead):
|
||||
"""Charge the two initial full epochs via their bookings once, then project only remaining work."""
|
||||
p = candidate['projection']
|
||||
amounts = (other_unsettled, approved_greif_cap, remaining_overhead)
|
||||
if any(type(v) not in (int, float) or not math.isfinite(v) or v < 0 for v in amounts) or approved_greif_cap == 0:
|
||||
raise ValueError('Explicit phase reservations, approved Greif cap and overhead needed')
|
||||
cap = min(approved_greif_cap, p['upper_remaining_before_other_bookings_gpu_seconds'] - other_unsettled)
|
||||
if set(receipts) != set(candidate['folds']):
|
||||
return dict(status='HOLD_MISSING_BOTH_EPOCH_RECEIPTS', release_epoch2=False)
|
||||
spent = work = 0.
|
||||
for fold, expected in candidate['folds'].items():
|
||||
r = receipts[fold]
|
||||
if (r['fold'], r['seed'], r['epoch'], r['learning_cases'], r['learning_nodes'], r['heldout_target_reads']) != (
|
||||
int(fold), 0, 1, len(expected['parts']['learning']), expected['learning_nodes'], 0):
|
||||
raise ValueError('First epoch receipt is not this fold’s full learning scope')
|
||||
t, charge = r['epoch_seconds'], r['booked_gpu_seconds']
|
||||
if not all(type(v) in (float,int) and math.isfinite(v) for v in (t,charge)) or not 0 < t <= charge:
|
||||
raise ValueError('Missing measured full epoch or booked setup time')
|
||||
spent += charge
|
||||
work += (2 * candidate['epochs'] - 1) * t
|
||||
projected = spent + math.ceil(1.25 * work) + remaining_overhead
|
||||
within = projected <= cap
|
||||
return dict(status='COST_WITHIN_CAP' if within else 'STOP_PROJECTED_CAP',
|
||||
charged_first_epochs_and_setup_gpu_seconds=spent, remaining_train_gpu_seconds=work,
|
||||
remaining_overhead_gpu_seconds=remaining_overhead, safety_factor=1.25,
|
||||
projected_greif_gpu_seconds=projected, phase_projection_gpu_seconds=p['accounted_gpu_seconds'] +
|
||||
other_unsettled + projected, effective_greif_cap_gpu_seconds=cap,
|
||||
release_epoch2=within)
|
||||
|
||||
|
||||
def binding():
|
||||
from track_b_gino_greif_adapter import COLUMNS, GRID, MODES, WIDTH
|
||||
|
||||
pilot, query, terminal = (read(checked(path, PINS[str(path)])) for path in (PILOT, QUERY, PHASE_TERMINAL))
|
||||
folds = grouped_folds(pilot, query)
|
||||
reference_formal = reference.contract()
|
||||
timing = reference_formal['formal']['timing']
|
||||
prior = terminal['cumulative_phase3_gpu_seconds']
|
||||
return dict(status=STATUS, handoff='h-539a65e1', working_entry='preparation_only',
|
||||
folds=folds, seeds=[0, 1],
|
||||
return dict(status=STATUS, handoff='h-1789ca7e', working_entry='preparation_only',
|
||||
folds=folds, seeds=[0, 1], epochs=EPOCHS, h2_reference_support=paired_support(pilot, query, folds),
|
||||
jobs=[dict(fold=fold, seed=seed) for fold in (0, 1) for seed in (0, 1)],
|
||||
sources=PINS,
|
||||
reuse_h2=dict(features='original 19 standardized on each fold learning only', geometry='full retained tet nodes',
|
||||
mass='original positive nodal mass', input_clock='original FP64 Vf and frozen learning c',
|
||||
train_target='same normalized residual as H2 candidate', readout='same cF and seconds decode',
|
||||
case_query='original fixed PPS/query multiplicity and raw IDs', target_reads_in_preparation=0),
|
||||
adapter_candidate=dict(status='NEEDS_SCIENTIFIC_REVIEW',
|
||||
method='propose GNO/FNO/GNO with same node features carried into and out of the latent grid',
|
||||
open=['latent grid and feature transport', 'training epochs and learning schedule',
|
||||
'phase pool and test target access sequencing']),
|
||||
projection=dict(settled_phase3_through_1b_gpu_seconds=prior,
|
||||
gino_measurement_once_gpu_seconds=timing['prior_measurement_gpu_seconds'],
|
||||
gino_shapenet_formal_reserve_gpu_seconds=40000, h2_pressure_unsettled_max_gpu_seconds=40000,
|
||||
phase_cap_gpu_seconds=CAP, measured_greif_epoch_seconds=None,
|
||||
complete_projection=None, status='BLOCKED_PENDING_COMPLETE_PHASE_PROJECTION'),
|
||||
adapter_candidate=dict(identity='GINO-Greif fixed trilinear GNO / Tucker FNO / trilinear GNO',
|
||||
resolution=[GRID]*3, width=WIDTH, modes=list(MODES), columns=list(COLUMNS),
|
||||
first_grid_input='nineteen mass-weighted trilinear means and one occupancy bit',
|
||||
coordinates='isotropic part bounding cube, one grid cell margin',
|
||||
readout='tri-linear gather at original nodes plus same original 19 column skip',
|
||||
pressure_or_sdf_channels_added=False,
|
||||
model_environment=reference_formal['environment']),
|
||||
training_candidate=dict(schedule='same H2 AdamW, 10 warmup, 190 cosine, 200 full epochs',
|
||||
epoch_shuffle='PCG64 SeedSequence([seed, epoch])', loss='same H2 node-equal per-part weighted FP32 MSE and gradient clip 1',
|
||||
no_validation_selection=True, match='exact fold × seed, matching H2 features and residual target',
|
||||
model_choice_before_launch=True),
|
||||
scoring_custody=dict(review_gate=True, require_all_four_final_checkpoints=True,
|
||||
predictions_all_full_nodes_frozen_before_target_access=True,
|
||||
planned_single_read_of_each_original_test_case=True,
|
||||
paper_gate_applies_to_shape_pressure_only=True, use_frozen_pps_multiplicity=True,
|
||||
report=['relative L2','last_location/Rg','Kendall tau-b'],
|
||||
topology_weld_line_claims=False),
|
||||
projection=phase_ledger(prior, timing, reference_formal['formal']['total_gpu_wall_seconds']),
|
||||
admission=dict(preferred_ordinals=[0,1,2], last_ordinal=3, gpu3_single_task=True,
|
||||
require_actual_stage_approval=True, max_two_initial_seed0_full_epochs_before_projection=True),
|
||||
production_guard_limits=reference_formal['limits'],
|
||||
launch_authorized=False,
|
||||
code_sha256={str(path): sha(path) for path in (
|
||||
Path(__file__).resolve(), reference.SOURCES/'phase2_h2_data.py',
|
||||
reference.SOURCES/'phase2_residual_math.py', reference.SOURCES/'track_b_gino_formal_guard.py')})
|
||||
reference.SOURCES/'phase2_residual_math.py', reference.SOURCES/'track_b_gino_formal_guard.py',
|
||||
reference.SOURCES/'s2_recovery_gpu_supervisor.py', reference.SOURCES/'track_b_gino_greif_adapter.py',
|
||||
reference.SOURCES/'gre24_features_v2.py', reference.SOURCES/'s2_custody_statistics.py',
|
||||
reference.SOURCES/'phase2_h2_model.py')})
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
@@ -103,6 +204,6 @@ if __name__ == '__main__':
|
||||
args = parser.parse_args()
|
||||
c = binding()
|
||||
if args.write_binding:
|
||||
ROOT.mkdir(exist_ok=False)
|
||||
save(ROOT/'preparation-binding.json', c)
|
||||
REVIEW_ROOT.mkdir(exist_ok=False)
|
||||
save(REVIEW_ROOT/'preparation-binding.json', c)
|
||||
print(json.dumps({key: c[key] for key in ('status', 'jobs', 'projection', 'launch_authorized')}, indent=2))
|
||||
Reference in new issue
Block a user