diffneusim 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- diffneusim/__init__.py +1 -0
- diffneusim/_cache.py +42 -0
- diffneusim/_paths.py +5 -0
- diffneusim/bindings/rew14_ext.cu +115 -0
- diffneusim/bindings/soft14_capi.cpp +443 -0
- diffneusim/bindings/soft14_engine_ext.cu +596 -0
- diffneusim/bindings/soft_capi.cpp +782 -0
- diffneusim/bindings/soft_engine_ext.cu +495 -0
- diffneusim/core/cpu_engine/build.sh +40 -0
- diffneusim/core/cpu_engine/fiber/cuda_runtime.h +445 -0
- diffneusim/core/cpu_engine/x14_cpu.cpp +283 -0
- diffneusim/core/diff/dual.h +126 -0
- diffneusim/core/include/diffneusim/macros.h +35 -0
- diffneusim/core/kin/kinematic_tree.h +273 -0
- diffneusim/core/math/so3.h +182 -0
- diffneusim/core/soft/adj/out_adj.h +102 -0
- diffneusim/core/soft/adj/rnea_adj.h +425 -0
- diffneusim/core/soft/adj/rows_adj.h +439 -0
- diffneusim/core/soft/adj/rows_functor.h +89 -0
- diffneusim/core/soft/adj/rows_lanes.h +443 -0
- diffneusim/core/soft/adj/shell_adj.h +243 -0
- diffneusim/core/soft/adj/tree_adj.h +356 -0
- diffneusim/core/soft/collide.h +183 -0
- diffneusim/core/soft/gpu/adj14.cuh +233 -0
- diffneusim/core/soft/gpu/adj14_mus.cuh +98 -0
- diffneusim/core/soft/gpu/adj_shell.cuh +50 -0
- diffneusim/core/soft/gpu/adj_tab.cuh +49 -0
- diffneusim/core/soft/gpu/body14.cuh +47 -0
- diffneusim/core/soft/gpu/chol_rn.cuh +458 -0
- diffneusim/core/soft/gpu/chol_small.cuh +123 -0
- diffneusim/core/soft/gpu/chol_split.cuh +193 -0
- diffneusim/core/soft/gpu/engine_launch.cuh +263 -0
- diffneusim/core/soft/gpu/fk_rn.cuh +109 -0
- diffneusim/core/soft/gpu/generated/body_019e20820f86_mmfloor.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_62f77a4bb16b_mmfloor.cuh +52 -0
- diffneusim/core/soft/gpu/generated/body_77dbb7213f26_mmfloor_rampsb3l_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rampsb3l_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsd05_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsdef_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsmjd_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +52 -0
- diffneusim/core/soft/gpu/generated/body_a944653edd64_mmfloor.cuh +25 -0
- diffneusim/core/soft/gpu/generated/body_a944653edd64_mmfloor_rampsb3l_n6t12.cuh +25 -0
- diffneusim/core/soft/gpu/generated/g1_soft_5db44fd45286.cuh +74 -0
- diffneusim/core/soft/gpu/generated/split_62f77a4bb16b_mmfloor.cuh +18 -0
- diffneusim/core/soft/gpu/generated/split_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +18 -0
- diffneusim/core/soft/gpu/generated/x14_soft_019e20820f86_mmfloor.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_62f77a4bb16b_mmfloor.cuh +129 -0
- diffneusim/core/soft/gpu/generated/x14_soft_77dbb7213f26_mmfloor_rampsb3l_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rampsb3l_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsd05_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsdef_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsmjd_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +129 -0
- diffneusim/core/soft/gpu/generated/x14_soft_a944653edd64_mmfloor.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_a944653edd64_mmfloor_rampsb3l_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/k_mus.cuh +1038 -0
- diffneusim/core/soft/gpu/k_mus_host.cuh +377 -0
- diffneusim/core/soft/gpu/k_pre.cuh +52 -0
- diffneusim/core/soft/gpu/kernel_p.cuh +490 -0
- diffneusim/core/soft/gpu/kp14.cuh +465 -0
- diffneusim/core/soft/gpu/l2v2.cuh +367 -0
- diffneusim/core/soft/gpu/l2x14.cuh +319 -0
- diffneusim/core/soft/gpu/l3.cuh +1483 -0
- diffneusim/core/soft/gpu/model_view.cuh +48 -0
- diffneusim/core/soft/gpu/mus_case_fits.h +15 -0
- diffneusim/core/soft/gpu/mus_classes.h +182 -0
- diffneusim/core/soft/gpu/mus_row_cf.h +44 -0
- diffneusim/core/soft/gpu/rew14.cuh +177 -0
- diffneusim/core/soft/gpu/rows_ctab.cuh +44 -0
- diffneusim/core/soft/gpu/tree_m.cuh +247 -0
- diffneusim/core/soft/gpu/x14_engine_kernels.cuh +260 -0
- diffneusim/core/soft/gpu/x14_rowcf.h +14 -0
- diffneusim/core/soft/hand.h +124 -0
- diffneusim/core/soft/impedance.h +115 -0
- diffneusim/core/soft/jvp.h +202 -0
- diffneusim/core/soft/kin.h +250 -0
- diffneusim/core/soft/muscle.h +1208 -0
- diffneusim/core/soft/newton.h +371 -0
- diffneusim/core/soft/rows.h +176 -0
- diffneusim/core/soft/step.h +188 -0
- diffneusim/core/soft/tape.h +313 -0
- diffneusim/core/soft/x14/collide14.h +69 -0
- diffneusim/core/soft/x14/jvp14.h +182 -0
- diffneusim/core/soft/x14/law14.h +453 -0
- diffneusim/core/soft/x14adj/collide14_adj.h +134 -0
- diffneusim/core/soft/x14adj/passive14_adj.h +162 -0
- diffneusim/core/soft/x14adj/reward14.h +484 -0
- diffneusim/core/soft/x14adj/rows14_adj.h +400 -0
- diffneusim/core/soft/x14adj/scan14.h +349 -0
- diffneusim/core/soft/x14adj/shell14_adj.h +122 -0
- diffneusim/core/soft/x14adj/sweep14.h +255 -0
- diffneusim/core/soft/x14adj/tree14_adj.h +500 -0
- diffneusim/core/soft/x14adj/x14adj_common.h +96 -0
- diffneusim/data/mirror/H1622v2k_geyer_hfdeq.npz +0 -0
- diffneusim/data/mirror/H1622v2k_hfd.npz +0 -0
- diffneusim/data/mirror/H1622v2k_millard_hfdeq.npz +0 -0
- diffneusim/data/mirror/fullbody_contact.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_p2str.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_p2str_rigid.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_calf2_pe.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfix.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfixlegs01.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01legs.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01lumbar.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_lumbfix.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_lumbfixlegs01.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1a.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n2.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_rom23.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_hinge.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1a.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n2.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_rom23.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_lspine_girdle_osimeq.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_lspine_girdle_millard.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_lspine_girdle_osimeq.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_compound_g14eq.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30_luispe.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30_trunk0701.npz +0 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_axfix.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_axfixlegs01.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01legs.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01lumbar.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_lumbfix.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_lumbfixlegs01.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_n1.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_n1a.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_n2.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_rom23.json +91 -0
- diffneusim/data/reference/musclemimic/myofullbody_mimic_sites.json +261 -0
- diffneusim/data/reference/pose3/pose3_scone.json +305 -0
- diffneusim/data/reference/pose3/pose3_scone.txt +3 -0
- diffneusim/data/reference/pose3/pose3_scone_gait.npz +0 -0
- diffneusim/data/reference/pose3/pose3_scone_mirror.npz +0 -0
- diffneusim/data/reference/pose3/pose3_scone_stand.npz +0 -0
- diffneusim/data/reference/x016run/MD5SUMS +241 -0
- diffneusim/data/reference/x016run/x016run_states.txt +240 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r3.npz +0 -0
- diffneusim/data/state_prior/lumbar_poly_fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
- diffneusim/engine/__init__.py +0 -0
- diffneusim/engine/build_tag.py +52 -0
- diffneusim/engine/case_tables.py +46 -0
- diffneusim/engine/d16_body.py +80 -0
- diffneusim/engine/engine14.py +367 -0
- diffneusim/engine/gen_split.py +159 -0
- diffneusim/engine/hand_format.py +69 -0
- diffneusim/engine/live14.py +149 -0
- diffneusim/engine/phase_b_tree.py +137 -0
- diffneusim/engine/soft14.py +130 -0
- diffneusim/engine/soft_capi.py +373 -0
- diffneusim/engine/soft_engine.py +165 -0
- diffneusim/engine/step14.py +132 -0
- diffneusim/engine/tape_format.py +89 -0
- diffneusim/engine/x14cpu.py +163 -0
- diffneusim/env/__init__.py +0 -0
- diffneusim/env/absent.py +20 -0
- diffneusim/env/cpu14.py +105 -0
- diffneusim/env/e0loop14.py +224 -0
- diffneusim/env/env14.py +568 -0
- diffneusim/env/kin_contact14.py +193 -0
- diffneusim/env/mimic_sites_x14.json +366 -0
- diffneusim/env/old_count.py +78 -0
- diffneusim/env/rew14.py +114 -0
- diffneusim/env/rew14_hook.py +105 -0
- diffneusim/g1/__init__.py +1 -0
- diffneusim/g1/arm_a2.py +165 -0
- diffneusim/g1/arm_a3.py +576 -0
- diffneusim/g1/read_a3.py +79 -0
- diffneusim/g1/rg1_read.py +89 -0
- diffneusim/model/__init__.py +66 -0
- diffneusim/model/case.py +17 -0
- diffneusim/model/dnmodel.py +79 -0
- diffneusim/model/fuse_fixed.py +281 -0
- diffneusim/model/monitor.py +834 -0
- diffneusim/models/BODIES.toml +48 -0
- diffneusim/models/MANIFEST.toml +979 -0
- diffneusim/models/cases/G290/case.bin +0 -0
- diffneusim/models/cases/G290/case.json +1 -0
- diffneusim/models/cases/G356-SRC/case.bin +0 -0
- diffneusim/models/cases/G356-SRC/case.json +1 -0
- diffneusim/models/cases/G416/case.bin +0 -0
- diffneusim/models/cases/G416/case.json +1 -0
- diffneusim/models/cases/M290C-SRC/case.bin +0 -0
- diffneusim/models/cases/M290C-SRC/case.json +1 -0
- diffneusim/models/cases/M290R-SRC/case.bin +0 -0
- diffneusim/models/cases/M290R-SRC/case.json +1 -0
- diffneusim/models/cases/M356C-SRC/case.bin +0 -0
- diffneusim/models/cases/M356C-SRC/case.json +1 -0
- diffneusim/models/cases/M356R-SRC/case.bin +0 -0
- diffneusim/models/cases/M356R-SRC/case.json +1 -0
- diffneusim/models/cases/M416C-SRC/case.bin +0 -0
- diffneusim/models/cases/M416C-SRC/case.json +1 -0
- diffneusim/models/derived/d16_expanded_62f77a4bb16b1e67_mmfloor.xml +673 -0
- diffneusim/models/derived/d16_expanded_a1e8b196b2cd7b3c_mmfloor.xml +673 -0
- diffneusim/models/derived/d16_soft_law_019e20820f8633b9_mmfloor.json +7844 -0
- diffneusim/models/derived/d16_soft_law_62f77a4bb16b1e67_mmfloor.json +16855 -0
- diffneusim/models/derived/d16_soft_law_77dbb7213f26e821_mmfloor_rampsb3l_n6t12.json +7883 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rampsb3l_n6t12.json +7883 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsd05_n6t12.json +7868 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsdef_n6t12.json +7868 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsmjd_n6t12.json +7868 -0
- diffneusim/models/derived/d16_soft_law_a1e8b196b2cd7b3c_mmfloor_rampsb3l_n6t12.json +16894 -0
- diffneusim/models/derived/d16_soft_law_a944653edd642082_mmfloor.json +12655 -0
- diffneusim/models/derived/d16_soft_law_a944653edd642082_mmfloor_rampsb3l_n6t12.json +12700 -0
- diffneusim/models/derived/unitree_g1_soft_law.json +15580 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +28913 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.dnmodel +29202 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfixlegs01.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +46970 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +38570 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.dnmodel +38923 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
- diffneusim/models/fullbody_meshes/1mc.stl +0 -0
- diffneusim/models/fullbody_meshes/2distph.stl +0 -0
- diffneusim/models/fullbody_meshes/2mc.stl +0 -0
- diffneusim/models/fullbody_meshes/2midph.stl +0 -0
- diffneusim/models/fullbody_meshes/2proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/3distph.stl +0 -0
- diffneusim/models/fullbody_meshes/3mc.stl +0 -0
- diffneusim/models/fullbody_meshes/3midph.stl +0 -0
- diffneusim/models/fullbody_meshes/3proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/4distph.stl +0 -0
- diffneusim/models/fullbody_meshes/4mc.stl +0 -0
- diffneusim/models/fullbody_meshes/4midph.stl +0 -0
- diffneusim/models/fullbody_meshes/4proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/5distph.stl +0 -0
- diffneusim/models/fullbody_meshes/5mc.stl +0 -0
- diffneusim/models/fullbody_meshes/5midph.stl +0 -0
- diffneusim/models/fullbody_meshes/5proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/NOTICE +2 -0
- diffneusim/models/fullbody_meshes/capitate.stl +0 -0
- diffneusim/models/fullbody_meshes/clavicle.stl +0 -0
- diffneusim/models/fullbody_meshes/hamate.stl +0 -0
- diffneusim/models/fullbody_meshes/hat_cervical.stl +0 -0
- diffneusim/models/fullbody_meshes/hat_jaw.stl +0 -0
- diffneusim/models/fullbody_meshes/hat_skull.stl +0 -0
- diffneusim/models/fullbody_meshes/humerus.stl +0 -0
- diffneusim/models/fullbody_meshes/l_bofoot.stl +0 -0
- diffneusim/models/fullbody_meshes/l_femur.stl +0 -0
- diffneusim/models/fullbody_meshes/l_fibula.stl +0 -0
- diffneusim/models/fullbody_meshes/l_foot.stl +0 -0
- diffneusim/models/fullbody_meshes/l_patella.stl +0 -0
- diffneusim/models/fullbody_meshes/l_pelvis.stl +0 -0
- diffneusim/models/fullbody_meshes/l_talus.stl +0 -0
- diffneusim/models/fullbody_meshes/l_tibia.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar1.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar2.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar3.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar4.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar5.stl +0 -0
- diffneusim/models/fullbody_meshes/lunate.stl +0 -0
- diffneusim/models/fullbody_meshes/pisiform.stl +0 -0
- diffneusim/models/fullbody_meshes/r_bofoot.stl +0 -0
- diffneusim/models/fullbody_meshes/r_femur.stl +0 -0
- diffneusim/models/fullbody_meshes/r_fibula.stl +0 -0
- diffneusim/models/fullbody_meshes/r_foot.stl +0 -0
- diffneusim/models/fullbody_meshes/r_patella.stl +0 -0
- diffneusim/models/fullbody_meshes/r_pelvis.stl +0 -0
- diffneusim/models/fullbody_meshes/r_talus.stl +0 -0
- diffneusim/models/fullbody_meshes/r_tibia.stl +0 -0
- diffneusim/models/fullbody_meshes/radius.stl +0 -0
- diffneusim/models/fullbody_meshes/sacrum.stl +0 -0
- diffneusim/models/fullbody_meshes/scaphoid.stl +0 -0
- diffneusim/models/fullbody_meshes/scapula.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic10_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic11_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic12_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic1_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic2_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic3_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic4_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic5_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic6_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic7_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic8_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic9_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thorax.stl +0 -0
- diffneusim/models/fullbody_meshes/thumbdist.stl +0 -0
- diffneusim/models/fullbody_meshes/thumbprox.stl +0 -0
- diffneusim/models/fullbody_meshes/trapezium.stl +0 -0
- diffneusim/models/fullbody_meshes/trapezoid.stl +0 -0
- diffneusim/models/fullbody_meshes/triquetrum.stl +0 -0
- diffneusim/models/fullbody_meshes/ulna.stl +0 -0
- diffneusim/models/source/myo_fullbody/UPSTREAM.md +91 -0
- diffneusim/models/source/myoleg/UPSTREAM.md +52 -0
- diffneusim/models/source/unitree_g1/LICENSE.mjlab +202 -0
- diffneusim/models/source/unitree_g1/UPSTREAM.md +38 -0
- diffneusim/models/source/unitree_g1/assets/head_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_ankle_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_ankle_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_elbow_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_hip_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_hip_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_hip_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_knee_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_rubber_hand.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_shoulder_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_shoulder_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_shoulder_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_wrist_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_wrist_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_wrist_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/logo_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/pelvis.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/pelvis_contour_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_ankle_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_ankle_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_elbow_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_hip_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_hip_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_hip_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_knee_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_rubber_hand.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_shoulder_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_shoulder_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_shoulder_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_wrist_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_wrist_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_wrist_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/torso_link_rev_1_0.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/waist_roll_link_rev_1_0.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/waist_yaw_link_rev_1_0.STL +0 -0
- diffneusim/models/source/unitree_g1/dump_mjlab_reference.py +30 -0
- diffneusim/models/source/unitree_g1/g1.xml +308 -0
- diffneusim/models/source/unitree_g1/g1_constants.py +298 -0
- diffneusim/models/source/unitree_g1/mjlab_compiled_reference.json +857 -0
- diffneusim/models/unitree_g1.dnmodel +4393 -0
- diffneusim/models/unitree_g1_selfcol.dnmodel +20824 -0
- diffneusim/rl/__init__.py +2 -0
- diffneusim/rl/dynsyn_layer.py +146 -0
- diffneusim/rl/footstep_plan.py +337 -0
- diffneusim/rl/g1_bm_env.py +572 -0
- diffneusim/rl/g1_bm_eval.py +168 -0
- diffneusim/rl/g1_bm_fused.py +275 -0
- diffneusim/rl/g1_bm_ppo.py +622 -0
- diffneusim/rl/g1_bm_sapo.py +551 -0
- diffneusim/rl/g1_ppo.py +395 -0
- diffneusim/rl/g1_sapo_soft.py +240 -0
- diffneusim/rl/g1_soft_env.py +452 -0
- diffneusim/rl/g1_soft_grad.py +145 -0
- diffneusim/rl/geyer_curves_torch.py +108 -0
- diffneusim/rl/gpu_fullbody_vec_env.py +1241 -0
- diffneusim/rl/imitation.py +2027 -0
- diffneusim/rl/imitation_reward_v2.py +248 -0
- diffneusim/rl/imitation_reward_v3.py +349 -0
- diffneusim/rl/latent_task.py +175 -0
- diffneusim/rl/llc_reward.py +316 -0
- diffneusim/rl/millard_curves_torch.py +154 -0
- diffneusim/rl/mirror_symmetry.py +212 -0
- diffneusim/rl/model_path.py +35 -0
- diffneusim/rl/mvae_recon.py +123 -0
- diffneusim/rl/nets_shac.py +599 -0
- diffneusim/rl/reset_pool.py +154 -0
- diffneusim/rl/sapo_capture.py +873 -0
- diffneusim/rl/sapo_vec.py +1051 -0
- diffneusim/rl/shac_vec.py +346 -0
- diffneusim/rl/state_prior.py +151 -0
- diffneusim/rl/step_library.py +105 -0
- diffneusim/rl/task_walk_env.py +1793 -0
- diffneusim/rl/task_walk_reward.py +3300 -0
- diffneusim/run.py +23 -0
- diffneusim/run_env.py +46 -0
- diffneusim/tasks/__init__.py +147 -0
- diffneusim/tasks/legacy_names.py +63 -0
- diffneusim/tasks/paths.py +79 -0
- diffneusim/tasks/settings.py +202 -0
- diffneusim/third_party/instantmimic_947430ee/LICENSE +202 -0
- diffneusim/third_party/instantmimic_947430ee/NOTICE +19 -0
- diffneusim/third_party/instantmimic_947430ee/README.md +31 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/benchmark_protocol.py +106 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/metrics.py +214 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/reference.py +513 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/motion/quaternion.py +193 -0
- diffneusim/train/__init__.py +0 -0
- diffneusim/train/eval_ckpt.py +239 -0
- diffneusim/train/eval_mimic.py +133 -0
- diffneusim/train/gait_report.py +203 -0
- diffneusim/train/gcot_chain.py +51 -0
- diffneusim/train/levers.py +135 -0
- diffneusim/train/masked_reset.py +314 -0
- diffneusim/train/rl_algorithm_suite.py +917 -0
- diffneusim/train/train14.py +240 -0
- diffneusim/train/train_tw14.py +674 -0
- diffneusim/viz/__init__.py +5 -0
- diffneusim/viz/__main__.py +41 -0
- diffneusim/viz/camera.py +115 -0
- diffneusim/viz/dnrec.py +118 -0
- diffneusim/viz/dnrec_io.py +686 -0
- diffneusim/viz/hud.py +565 -0
- diffneusim/viz/meshes.py +458 -0
- diffneusim/viz/play.py +237 -0
- diffneusim/viz/record.py +74 -0
- diffneusim/viz/render.py +1402 -0
- diffneusim/viz/renderer.py +268 -0
- diffneusim/viz/rl_env_render.py +635 -0
- diffneusim/viz/snapshot.py +54 -0
- diffneusim/viz/strobe.py +124 -0
- diffneusim/viz/to_mp4.py +58 -0
- diffneusim/viz/ui.py +481 -0
- diffneusim/viz/viewer.py +2086 -0
- diffneusim-1.0.0.dist-info/METADATA +226 -0
- diffneusim-1.0.0.dist-info/RECORD +682 -0
- diffneusim-1.0.0.dist-info/WHEEL +5 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSE +201 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/BSD-3-Clause-NC-ARMS-hand-wrist-4.3.txt +20 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/BSD-3-Clause-NC-MoBL-ARMS.txt +25 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/CC-BY-3.0-OpenSim-geometry.txt +25 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Christophy2012-lumbarspine.txt +10 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Lai2017-model-high-flex.txt +10 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Lee2015-hand_muscle.txt +11 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Rajagopal2016-full_body.txt +11 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Uhlrich2022-fbmodpassivecal.txt +10 -0
- diffneusim-1.0.0.dist-info/licenses/NOTICE +274 -0
- diffneusim-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,674 @@
|
|
|
1
|
+
"""feat/d16-taskwalk's training driver: tools/rl_algorithm_suite.py train, run from the tree's root with a cell's env file sourced, plus,
|
|
2
|
+
installed right after make_algo with no trainer source edit (as tools/e0speed/learn/train14.py on the E0 branches):
|
|
3
|
+
- the D16 engine: env14.install_from_env (E0_ENGINE14=1, E0_TREE14 = this tree, E0_MUSCLE_CASE the body's case), with the line's switches
|
|
4
|
+
required ON and proved at every control step by env14's own asserts: E0_ENV14_ACT14 (the reward's activation is the engine's op, old_act 0),
|
|
5
|
+
E0_ENV14_KINLATCH (the mirror latch on the D16 contact set, old_contact 0), E0_ENV14_GROUND14 (the reset grounded on the D16 foot geoms),
|
|
6
|
+
E0_ENV14_NO_OLD (old_sim 0), E0_ENV14_EQUIL14 (the reset's fibres at the D16 equilibrium); E0_ENV14_REW14=0 (the fused node refuses
|
|
7
|
+
taskwalk);
|
|
8
|
+
- one reset of every world right after the install: the env's constructor reset them on the old path (the old grounding and the old
|
|
9
|
+
engine's fibre equilibrium) and SapoVec.train does not reset at its start (memory: construction-reset-runs-before-env14-install), so
|
|
10
|
+
without it every world's first episode would start from the old path's state. Asserted: one GROUND14 call for all n worlds.
|
|
11
|
+
The imitation ban (PLAN.md 1.2b) is asserted too: no kickstart (SAPO_KICKSTART_*), the clip reset only as ks14t's own (D16_TW_RESET=ks14t_clip,
|
|
12
|
+
the design's 11-10 direction: a reset pose is a state value), no other imitation channel, no imitation
|
|
13
|
+
(DN_IMITATION), and a warm start (SUITE_INIT_CKPT) only from a checkpoint of this line: its run_config.json must carry this line's
|
|
14
|
+
switches and no kickstart and no further warm start (the R cells start from their W parent). A clip RESET in the parent's run is allowed
|
|
15
|
+
(the design's 11-10 rule via the review: the reference motion is never tracked; a reset pose is a state value).
|
|
16
|
+
The brake is off (the review's decision (A)): TASKWALK_W_BRAKE and _END must be 0.
|
|
17
|
+
Every argument after the script's name goes to rl_algorithm_suite.py unchanged."""
|
|
18
|
+
import atexit
|
|
19
|
+
import json
|
|
20
|
+
import os
|
|
21
|
+
import pathlib
|
|
22
|
+
import sys
|
|
23
|
+
import time
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def RAW():
|
|
27
|
+
"""CLOCK_MONOTONIC_RAW (s): neu's CLOCK_MONOTONIC (perf_counter) is slewed 1-10% and its REALTIME (time.time, the suite's log) stepped
|
|
28
|
+
~1 s every ~33 s (memory: neu-perf-counter-slow-since-1106); RAW is clean"""
|
|
29
|
+
return time.clock_gettime(time.CLOCK_MONOTONIC_RAW)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
T_IMPORT = RAW()
|
|
33
|
+
from diffneusim._paths import ROOT as ROOT # (3a) the repo root
|
|
34
|
+
# (3a) was: sys.path[:0] = [str(ROOT / "tools"), str(ROOT / "tools" / "diagnostics")]
|
|
35
|
+
import torch # noqa: E402
|
|
36
|
+
from diffneusim.train import rl_algorithm_suite as S # noqa: E402
|
|
37
|
+
|
|
38
|
+
KS14T_CLIP = "data/reference/cmu/07_01_loop_fullbody_lspine_ref.npz" # ks14t's TASKWALK_INIT_REF (its env file), md5 9e7f5d93
|
|
39
|
+
# PREREG_S290 Amendment 14 (the review, 11-12): the sprint's RUNNING-state reset, CMU 09_01 (subject 9, a straight run, 3.83 m/s) retargeted
|
|
40
|
+
# onto the lspine body with the tool's RUN grounding (one height shift, the flight kept) and looped without the walk-only re-grounding;
|
|
41
|
+
# a state sampler only (the reward never reads it), drawn by the same RSI-with-noise path as the walking clip. The md5 is asserted.
|
|
42
|
+
RUN_CLIP = ("data/reference/cmu/09_01_loop_fullbody_lspine_ref.npz", "cb4efee048b013de335c63cbb3cf142d")
|
|
43
|
+
# RESET-MA / RESET-S11 (11-12, the review; the design's 19:37 "solve the crouch gait"): STRAIGHT-KNEED walking resets, the two lab-derived
|
|
44
|
+
# loops the 10-17 survey found human-like at mid-stance (docs-dev/analysis/20261017_0310_reset_pose_0701_vs_s11). On N1-290 (the env's own
|
|
45
|
+
# imitation-task mapping): MyoAssist 1.28 m/s, knee landing 5.3 / 40 % 2.2, stance knee > 15 deg in 22 % of frames; subject 11 1.25 m/s,
|
|
46
|
+
# 4.5 / 4.5, 42 % (07_01: 1.41 m/s, 27.2 / 17.2, 96 %). State samplers only, drawn by the same RSI-with-noise path; the md5 is asserted.
|
|
47
|
+
MYOASSIST_CLIP = ("data/reference/cmu/myoassist_loop_fullbody_lspine_ref.npz", "c1f5d9937e4ac86b9fdf1cf74b1dfc55")
|
|
48
|
+
S11_CLIP = ("data/reference/cmu/rajagopal_s11_loop_fullbody_lspine_ref.npz", "2c53864a04845f3a550efddd4fe549bf")
|
|
49
|
+
# The pinned running-state reset clips, by D16_TW_RESET value; each drawn exactly as run_clip (the same RSI-with-noise path, TASKWALK_INIT_REF
|
|
50
|
+
# set to its path, its md5 asserted). run_clip_1646 (11-14, the design's faster running): CMU 16_46 (subject 16, a run at
|
|
51
|
+
# 4.36 m/s, 176 steps/min, step 1.49 m) by 09_01's retarget path, tools/reference/make_run_clip_lspine.sh 16_46 0.55 (b6be53b3a).
|
|
52
|
+
RUN_CLIPS = {"run_clip": RUN_CLIP,
|
|
53
|
+
"run_clip_1646": ("data/reference/cmu/16_46_loop_fullbody_lspine_ref.npz", "0c2115d44dfe3fc096d2dac2051956ba"),
|
|
54
|
+
"myoassist_clip": MYOASSIST_CLIP, "s11_clip": S11_CLIP}
|
|
55
|
+
# The pinned start-state SETS, by D16_TW_RESET value (11-17; the design's word via the review: predictive walking without human-motion
|
|
56
|
+
# initialization, three hard-coded starts "like SCONE"). pose3_scone: tools/d16_taskwalk/pose3/make_pose3.py's three states (SCONE's gait
|
|
57
|
+
# start mapped onto this body, its left-right mirror, the standing keyframe at rest), each a 1-frame LOOP clip in the model's own chart. The
|
|
58
|
+
# list goes in TASKWALK_INIT_REF; imitation.rsi draws a clip per world with equal probability (DN_CLIP_DRAW=clip) and, on T = 1, returns
|
|
59
|
+
# that frame itself (no blend), then the same RSI noise, limit clamp, ground14 and EQUIL14 as every clip reset. The list and every listed
|
|
60
|
+
# clip are md5-pinned; no other source of starts is allowed with it.
|
|
61
|
+
POSE_SETS = {"pose3_scone": ("data/reference/pose3/pose3_scone.txt", "d7e267ddb8254f464f4dad118f7bc6a1",
|
|
62
|
+
{"data/reference/pose3/pose3_scone_gait.npz": "3ecf41dbabf85150418f46e3d0545e0f",
|
|
63
|
+
"data/reference/pose3/pose3_scone_mirror.npz": "eeeeb30d1837db46b0b47cae0038d57d",
|
|
64
|
+
"data/reference/pose3/pose3_scone_stand.npz": "be0d7f466203245783bb7435840d2175"})}
|
|
65
|
+
# The pinned start-state LISTS, by D16_TW_RESET value (11-23; PREREG_S290 Amendment 16's start (b), the review 15:25): a list of many
|
|
66
|
+
# 1-frame clips in the pose3 format, drawn exactly as a POSE_SETS list (DN_CLIP_DRAW=clip: a clip per world with equal probability, then
|
|
67
|
+
# the same RSI noise, limit clamp, ground14 and EQUIL14). The list's md5 and its MD5SUMS file's md5 are pinned here, and every listed clip's
|
|
68
|
+
# md5 must be the one in that MD5SUMS. x016run_states: 256 single-support frames of the x016.1 s5 RUNNING chain's sampled evals (links 1-4,
|
|
69
|
+
# 2.90-3.65 m/s; the 2 STALL records skipped: 240 clips), tools/d16_taskwalk/x016run_states.py.
|
|
70
|
+
STATE_LISTS = {"x016run_states": ("data/reference/x016run/x016run_states.txt", "cbd4d081fa32d55224d9256bb90fbc8f", "5428303d502f6d5eb5e62ae1e8c791cd")}
|
|
71
|
+
from diffneusim.tasks.paths import announce as _announce
|
|
72
|
+
_announce("walking trainer")
|
|
73
|
+
ON = ("E0_ENGINE14", "E0_ENV14_ACT14", "E0_ENV14_KINLATCH", "E0_ENV14_GROUND14", "E0_ENV14_NO_OLD", "E0_ENV14_EQUIL14", "DN_TASKWALK",
|
|
74
|
+
"DN_MIRROR_SYM")
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def check_env():
|
|
78
|
+
"""the line's switches, the imitation ban, the brake, the tree, a warm start's ancestry: every assert before any construction"""
|
|
79
|
+
for k in ON:
|
|
80
|
+
assert os.environ.get(k) == "1", f"{k} must be 1 in this line's env file (set explicitly, recorded in run_config)"
|
|
81
|
+
assert os.environ.get("E0_ENV14_REW14") == "0", "E0_ENV14_REW14 must be 0: the fused node refuses taskwalk"
|
|
82
|
+
for k in ("SAPO_KICKSTART_CKPT", "SAPO_KICKSTART_W", "SAPO_KICKSTART_EPOCHS"):
|
|
83
|
+
assert not os.environ.get(k), f"{k} is banned in this line (PLAN.md 1.2b: no reference motion in training)"
|
|
84
|
+
rs = os.environ.get("D16_TW_RESET", "keyframe")
|
|
85
|
+
assert rs in ("keyframe", "ks14t_clip", "diag_states", *RUN_CLIPS, *POSE_SETS, *STATE_LISTS), \
|
|
86
|
+
f"D16_TW_RESET={rs!r}: keyframe, ks14t_clip, diag_states (eval only) or one of {list(RUN_CLIPS) + list(POSE_SETS) + list(STATE_LISTS)}"
|
|
87
|
+
if rs == "diag_states":
|
|
88
|
+
# (11-23; the review / 00:1x, the start-transient analysis) EVAL ONLY: the start states are a list of 1-frame clips cut from a record
|
|
89
|
+
# (GCOT 6.5 ep8450's own steady running, speedc/eval/steady_clips.py), drawn exactly as a POSE_SETS list (DN_CLIP_DRAW=clip, the same
|
|
90
|
+
# RSI noise, clamp, ground14 and EQUIL14). Refused in training (only eval_tw14 / eval_tw14_batched run it), without D16_TW_DIAG=steady_start,
|
|
91
|
+
# unless the list's md5 is D16_TW_DIAG_LIST_MD5 and every listed clip's md5 is the one in the MD5SUMS beside the list.
|
|
92
|
+
import hashlib
|
|
93
|
+
assert False, "D16_TW_RESET=diag_states needs D16_TW_DIAG=steady_start (an eval-only diagnostic)"
|
|
94
|
+
assert pathlib.Path(sys.argv[0]).name in ("eval_tw14.py", "eval_tw14_batched.py"), f"D16_TW_RESET=diag_states is EVAL ONLY, not {sys.argv[0]}"
|
|
95
|
+
lst = pathlib.Path(os.environ["TASKWALK_INIT_REF"])
|
|
96
|
+
got = hashlib.md5(lst.read_bytes()).hexdigest()
|
|
97
|
+
assert got == None, f"{lst}: md5 {got}, D16_TW_DIAG_LIST_MD5 {None!r}"
|
|
98
|
+
sums = dict(reversed(ln.split()) for ln in (lst.parent / "MD5SUMS").read_text().splitlines() if ln.strip())
|
|
99
|
+
for c in (ln.strip() for ln in lst.read_text().splitlines() if ln.strip()):
|
|
100
|
+
got = hashlib.md5(pathlib.Path(c).read_bytes()).hexdigest()
|
|
101
|
+
assert sums.get(pathlib.Path(c).name) == got, f"{c}: md5 {got}, MD5SUMS {sums.get(pathlib.Path(c).name)}"
|
|
102
|
+
for k in ("TASKWALK_INIT_REF_START", "TASKWALK_RSI_MIX_STEPS"):
|
|
103
|
+
assert not os.environ.get(k), f"diag_states: the listed states only ({k})"
|
|
104
|
+
elif rs == "keyframe":
|
|
105
|
+
assert not os.environ.get("TASKWALK_INIT_REF"), "TASKWALK_INIT_REF without D16_TW_RESET=ks14t_clip / a run clip"
|
|
106
|
+
elif rs == "ks14t_clip":
|
|
107
|
+
assert os.environ.get("TASKWALK_INIT_REF") == KS14T_CLIP, (os.environ.get("TASKWALK_INIT_REF"), KS14T_CLIP)
|
|
108
|
+
elif rs in STATE_LISTS:
|
|
109
|
+
import hashlib
|
|
110
|
+
lst, pin, sums_pin = STATE_LISTS[rs]
|
|
111
|
+
assert os.environ.get("TASKWALK_INIT_REF") == lst, (rs, os.environ.get("TASKWALK_INIT_REF"), lst)
|
|
112
|
+
got = hashlib.md5(pathlib.Path(lst).read_bytes()).hexdigest()
|
|
113
|
+
assert got == pin, f"{lst}: md5 {got}, pinned {pin}"
|
|
114
|
+
sp = pathlib.Path(lst).parent / "MD5SUMS"
|
|
115
|
+
got = hashlib.md5(sp.read_bytes()).hexdigest()
|
|
116
|
+
assert got == sums_pin, f"{sp}: md5 {got}, pinned {sums_pin}"
|
|
117
|
+
sums = dict(reversed(ln.split()) for ln in sp.read_text().splitlines() if ln.strip())
|
|
118
|
+
listed = [ln.strip() for ln in pathlib.Path(lst).read_text().splitlines() if ln.strip()]
|
|
119
|
+
assert listed and len(listed) == len(set(listed)), f"{lst}: empty or a clip listed twice"
|
|
120
|
+
for c in listed:
|
|
121
|
+
got = hashlib.md5(pathlib.Path(c).read_bytes()).hexdigest()
|
|
122
|
+
assert sums.get(pathlib.Path(c).name) == got, f"{c}: md5 {got}, MD5SUMS {sums.get(pathlib.Path(c).name)}"
|
|
123
|
+
for k in ("TASKWALK_INIT_REF_START", "TASKWALK_RSI_MIX_STEPS"):
|
|
124
|
+
assert not os.environ.get(k), f"{rs}: the pinned list only, no RSI pool curriculum ({k})"
|
|
125
|
+
elif rs in POSE_SETS:
|
|
126
|
+
import hashlib
|
|
127
|
+
lst, pin, clips = POSE_SETS[rs]
|
|
128
|
+
assert os.environ.get("TASKWALK_INIT_REF") == lst, (rs, os.environ.get("TASKWALK_INIT_REF"), lst)
|
|
129
|
+
got = hashlib.md5(pathlib.Path(lst).read_bytes()).hexdigest()
|
|
130
|
+
assert got == pin, f"{lst}: md5 {got}, pinned {pin}"
|
|
131
|
+
listed = [ln.strip() for ln in pathlib.Path(lst).read_text().splitlines() if ln.strip()]
|
|
132
|
+
assert listed == list(clips), f"{lst} lists {listed}, pinned {list(clips)}"
|
|
133
|
+
for c, m in clips.items():
|
|
134
|
+
got = hashlib.md5(pathlib.Path(c).read_bytes()).hexdigest()
|
|
135
|
+
assert got == m, f"{c}: md5 {got}, pinned {m}"
|
|
136
|
+
for k in ("TASKWALK_INIT_REF_START", "TASKWALK_RSI_MIX_STEPS"):
|
|
137
|
+
assert not os.environ.get(k), f"{rs}: the pinned set only, no RSI pool curriculum ({k})"
|
|
138
|
+
else:
|
|
139
|
+
import hashlib
|
|
140
|
+
clip, pin = RUN_CLIPS[rs]
|
|
141
|
+
assert os.environ.get("TASKWALK_INIT_REF") == clip, (rs, os.environ.get("TASKWALK_INIT_REF"), clip)
|
|
142
|
+
got = hashlib.md5(pathlib.Path(clip).read_bytes()).hexdigest()
|
|
143
|
+
assert got == pin, f"{clip}: md5 {got}, pinned {pin}"
|
|
144
|
+
for k in ("TASKWALK_STATE_PRIOR_FILE", "TASKWALK_PHASE_PRIOR_FILE", "DN_OUT_BIAS_FILE", "DN_SVD_BASIS", "TASKWALK_TRACK",
|
|
145
|
+
"TASKWALK_W_TRACK", "DN_IM_MIMIC"):
|
|
146
|
+
assert not os.environ.get(k) or os.environ.get(k) == "0", f"{k} is banned in this line (an imitation channel; the review's Low item)"
|
|
147
|
+
assert os.environ.get("DN_IMITATION", "0") == "0", "DN_IMITATION is banned in this line"
|
|
148
|
+
for k in ("TASKWALK_W_BRAKE", "TASKWALK_W_BRAKE_END"):
|
|
149
|
+
assert float(os.environ.get(k, "0")) == 0.0, f"{k}: the brake is off (hub 13's decision (A), a stated difference from ks14t)"
|
|
150
|
+
assert pathlib.Path(os.environ["E0_TREE14"]).resolve() == ROOT.resolve(), "E0_TREE14 must be this tree (one engine source)"
|
|
151
|
+
if os.environ.get("SUITE_INIT_CKPT"): # the R cells: the W parent's checkpoint, whose own run had no reference motion in its training
|
|
152
|
+
import json
|
|
153
|
+
_ck = pathlib.Path(os.environ["SUITE_INIT_CKPT"]).resolve()
|
|
154
|
+
assert _ck.parent.name == "ckpt", f"{_ck}: a suite checkpoint lives in <run>/ckpt/ (SUITE_SAVE_CKPTS)"
|
|
155
|
+
from diffneusim.tasks.legacy_names import translate as _legacy
|
|
156
|
+
_prc = json.loads((_ck.parent.parent / "run_config.json").read_text())
|
|
157
|
+
_prc["env_vars"] = _legacy(_prc["env_vars"]) # a paper run's record carries the development names (MYOLEG_* / JINSIMUL_*); read them as this package's
|
|
158
|
+
_rc = _prc["env_vars"]
|
|
159
|
+
for k in ON:
|
|
160
|
+
assert _rc.get(k) == "1", f"SUITE_INIT_CKPT's run had {k}={_rc.get(k)!r}: not a checkpoint of this line"
|
|
161
|
+
if os.environ.get("D16_TW_CHAIN") == "S290":
|
|
162
|
+
# PREREG_S290 (11-11): ONE further warm start allowed, R290 ep2000's Polyak shadow. The start is R290's checkpoint with only
|
|
163
|
+
# "actor" replaced by its own "actor_ema" (every other entry equal, asserted against the original, which D16_TW_CHAIN_SRC names
|
|
164
|
+
# and whose md5 is pinned); R290's run had no kickstart and no imitation, and its own warm start is W290b ep2000, whose
|
|
165
|
+
# ancestry R290's check_env passed when it trained.
|
|
166
|
+
import hashlib
|
|
167
|
+
import torch
|
|
168
|
+
src = pathlib.Path(os.environ["D16_TW_CHAIN_SRC"]).resolve()
|
|
169
|
+
md5 = hashlib.md5(src.read_bytes()).hexdigest()
|
|
170
|
+
assert md5 == "3e3b6eab1193b90881eedfacba5375a7", f"D16_TW_CHAIN S290 refuses {src} (md5 {md5})"
|
|
171
|
+
A, B = torch.load(src, map_location="cpu", weights_only=False), torch.load(_ck, map_location="cpu", weights_only=False)
|
|
172
|
+
assert set(A) == set(B) and "actor_ema" in A, (sorted(A), sorted(B))
|
|
173
|
+
def eq(x, y):
|
|
174
|
+
if torch.is_tensor(x):
|
|
175
|
+
return torch.is_tensor(y) and x.shape == y.shape and torch.equal(x, y)
|
|
176
|
+
if isinstance(x, dict):
|
|
177
|
+
return isinstance(y, dict) and set(x) == set(y) and all(eq(x[t], y[t]) for t in x)
|
|
178
|
+
if isinstance(x, (list, tuple)):
|
|
179
|
+
return isinstance(y, (list, tuple)) and len(x) == len(y) and all(eq(u, v) for u, v in zip(x, y))
|
|
180
|
+
return x == y
|
|
181
|
+
assert eq(B["actor"], A["actor_ema"]) and not eq(A["actor"], A["actor_ema"]), "the start's actor is not R290's shadow"
|
|
182
|
+
assert all(eq(A[k], B[k]) for k in A if k != "actor"), "the start differs from R290 ep2000 beyond the actor"
|
|
183
|
+
assert not _rc.get("SAPO_KICKSTART_CKPT") and str(_rc.get("SUITE_INIT_CKPT", "")).endswith("W290b_run/ckpt/fullbody_sapo_ep2000.pt"), _rc.get("SUITE_INIT_CKPT")
|
|
184
|
+
elif os.environ.get("D16_TW_CHAIN") == "GCOT":
|
|
185
|
+
# the GCOT warm-start chain (11-22; a design direction): the parent may itself be a chain link; gcot_chain.parent_ok
|
|
186
|
+
# asserts its run had no kickstart / imitation, was a cold root or a GCOT link, and the same change set except the speed schedule
|
|
187
|
+
# (3a) was: sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent)) # this file's folder also under e5_launch's runpy
|
|
188
|
+
from diffneusim.train import gcot_chain
|
|
189
|
+
_ok, _why = gcot_chain.parent_ok(_prc, dict(os.environ), sys.argv)
|
|
190
|
+
assert _ok, f"D16_TW_CHAIN=GCOT refuses {_ck}: {_why}"
|
|
191
|
+
print(f"[tw14] GCOT chain: parent {_ck} accepted ({_why})", flush=True)
|
|
192
|
+
else:
|
|
193
|
+
for k in ("SAPO_KICKSTART_CKPT", "SUITE_INIT_CKPT"):
|
|
194
|
+
assert not _rc.get(k), f"SUITE_INIT_CKPT's run had {k}: imitation (or a further warm start) in its ancestry"
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
orig_make_algo = S.make_algo
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def install(env, steps_num):
|
|
201
|
+
"""env14 on the env with the line's switches, then every world reset on the D16 path; returns env14's object"""
|
|
202
|
+
# (3a) was: sys.path.insert(0, str(ROOT / "tools" / "d16" / "e0train14"))
|
|
203
|
+
from diffneusim.env import env14
|
|
204
|
+
e14 = env14.install_from_env(env, steps_num)
|
|
205
|
+
assert e14 is not None and e14.equil_on and not e14.rew14_on, (e14, getattr(e14, "equil_on", None), getattr(e14, "rew14_on", None))
|
|
206
|
+
assert env14.ACT14 and env14.KINLATCH and env14.GROUND14 and env14.NO_OLD
|
|
207
|
+
with torch.no_grad():
|
|
208
|
+
env._reset_envs(None) # every world from the D16 path's reset (see the docstring)
|
|
209
|
+
assert e14.count["ground14"] == 1 and e14.count["old_sim"] == 0, dict(e14.count)
|
|
210
|
+
print(f"[tw14] env14 installed on {env.num_envs} worlds, every world reset on the D16 path; counts {dict(e14.count)}; D16_BODY "
|
|
211
|
+
f"{os.environ.get('D16_BODY', '(14x)')}; case {os.environ['E0_MUSCLE_CASE']}", flush=True)
|
|
212
|
+
return e14
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
EMA = os.environ.get("LEARN_EMA", "0") == "1"
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def install_ema(algo):
|
|
219
|
+
"""LEARN_EMA=1: the Polyak-averaged actor, a SHADOW for evaluation only, ported verbatim from the driver (tools/e0speed/learn/train14.py
|
|
220
|
+
on main): decay min(0.999, (1 + n) / (10 + n)) per actor update, built at the FIRST actor step (after the suite's warm start has loaded
|
|
221
|
+
the actor) from SUITE_INIT_CKPT's actor_ema when it has one, with the counter continued from the absolute epoch, else from the loaded
|
|
222
|
+
actor. Training never reads it; the checkpoint carries it beside the raw actor (ckpt_payload below). Scored from an EMA copy of the
|
|
223
|
+
checkpoint (actor := actor_ema, as the r1_eval.sh) through eval_tw14.py unchanged."""
|
|
224
|
+
ema, st0, m = {}, algo.actor_opt.step, {"n": None}
|
|
225
|
+
|
|
226
|
+
def ema_init():
|
|
227
|
+
off = int(getattr(algo, "epoch_offset", 0))
|
|
228
|
+
ck = os.environ.get("SUITE_INIT_CKPT")
|
|
229
|
+
src = torch.load(ck, map_location="cpu", weights_only=False).get("actor_ema") if ck else None
|
|
230
|
+
if src is not None:
|
|
231
|
+
ema.update({k: v.to(algo.device).clone() for k, v in src.items()})
|
|
232
|
+
else:
|
|
233
|
+
ema.update({k: v.detach().clone() for k, v in algo.actor.state_dict().items() if v.is_floating_point()})
|
|
234
|
+
# TW14_EMA_RESTART=1 (11-22, the GCOT warm chain): a warm cell restarts the shadow's counter at 0, so the shadow it is scored from
|
|
235
|
+
# averages like a cold cell of the same length instead of over the parent's climb (time constant about n / 9 epochs at an absolute n)
|
|
236
|
+
m["n"] = 0 if (ck and os.environ.get("TW14_EMA_RESTART") == "1") else off
|
|
237
|
+
print(f"[tw14] ema shadow from {'the checkpoint actor_ema' if src is not None else 'the actor'}, counter {m['n']}"
|
|
238
|
+
f"{' (TW14_EMA_RESTART: restarted, absolute epoch ' + str(off) + ')' if m['n'] != off else ''}", flush=True)
|
|
239
|
+
|
|
240
|
+
def step(*x, **kw):
|
|
241
|
+
if m["n"] is None:
|
|
242
|
+
ema_init()
|
|
243
|
+
out = st0(*x, **kw)
|
|
244
|
+
d = min(0.999, (1 + m["n"]) / (10 + m["n"]))
|
|
245
|
+
with torch.no_grad():
|
|
246
|
+
for k, v in algo.actor.state_dict().items():
|
|
247
|
+
if k in ema:
|
|
248
|
+
ema[k].mul_(d).add_(v.detach(), alpha=1.0 - d)
|
|
249
|
+
m["n"] += 1
|
|
250
|
+
return out
|
|
251
|
+
algo.actor_opt.step = step
|
|
252
|
+
algo._learn_ema = ema
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
# THE DEFAULT PATH (the review for the design brief, 11-11: a speed-up lands once in the shared training path and is every run's default): the
|
|
256
|
+
# captured window (--tw1-capture) with the reset pool (--tw1-pool), both gated bitwise to the eager loop (TW1 S2a / S2b's gates; the
|
|
257
|
+
# Python-side schedules under replay: PREREG_CAPSCHED). On the CUDA backend; the CPU backend (the Mac's dry runs) has no CUDA graphs, so
|
|
258
|
+
# there the default is the eager loop. --tw1-eager: the eager loop on CUDA, for debugging only. --tw1-capture / --tw1-pool stay accepted.
|
|
259
|
+
_CUDA = os.environ.get("E0_ENV14_BACKEND", "cuda") == "cuda"
|
|
260
|
+
TW1 = {"log_cmd": False, "log_w": False, "on": _CUDA, "W": None, "m1c": False, "tf32": False, "critic_iters": None, "k2": False, "no_final_eval": False, "stamps": None,
|
|
261
|
+
"pool": _CUDA}
|
|
262
|
+
# --tw1-capture, and S2c's --tw1-m1c / --tw1-tf32 / --tw1-critic-iters N (PREREG_TW1_S2c.md): explicit arguments, stripped before the
|
|
263
|
+
# suite's argv; run_config's tw1_capture record carries them (4e / 4d' are SapoVec's own SAPO_ switches, recorded by prefix).
|
|
264
|
+
# The clock's two (the review, 11-10: training + evaluation <= 10 min, measured from the launch command to the verdict file), neither changes
|
|
265
|
+
# the training:
|
|
266
|
+
# --tw1-stamps PATH CLOCK_MONOTONIC_RAW stamps to PATH at exit: the import, the algo built, train() entered / left, and every epoch's
|
|
267
|
+
# callback entered / left with its step count (the loop's cost per epoch = entry - the previous exit; the callback's
|
|
268
|
+
# own = its logging and checkpoint saves)
|
|
269
|
+
# --tw1-no-final-eval the suite's end-of-run eval (a second env built with env14 installed, then one deterministic episode of the LIVE
|
|
270
|
+
# actor) is skipped: it is not the registered reading (the shadow, sampled, 8 starts: eval_verdict.py); the metrics
|
|
271
|
+
# it would write are NaN / 0 with final_eval_skipped True
|
|
272
|
+
DRY = 0 # TW14_DRY_EPOCHS (wrap_dry), read in __main__ only: the tools that import this module (the gate's window, the census) never cut
|
|
273
|
+
ST = {"import": T_IMPORT, "env_built": None, "algo_core": None, "e14_installed": None, "tw1_installed": None, "algo_built": None, "train_entry": None, "train_exit": None, "cb_entry": [], "cb_exit": [], "steps": [],
|
|
274
|
+
"final_eval_s": None, "exit": None}
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def write_stamps():
|
|
278
|
+
ST["exit"] = RAW()
|
|
279
|
+
pathlib.Path(TW1["stamps"]).write_text(json.dumps(ST))
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
def wrap_train(algo):
|
|
283
|
+
"""--tw1-stamps: the epoch callback's entry and exit stamped (RAW); the suite's callback runs unchanged in between"""
|
|
284
|
+
tr = algo.train
|
|
285
|
+
|
|
286
|
+
def train(*x, callback=None, **kw):
|
|
287
|
+
ST["train_entry"] = RAW()
|
|
288
|
+
|
|
289
|
+
def cb(epoch, step_count, *r, **k):
|
|
290
|
+
ST["cb_entry"].append(RAW())
|
|
291
|
+
ST["steps"].append(int(step_count))
|
|
292
|
+
out = callback(epoch, step_count, *r, **k) if callback is not None else None
|
|
293
|
+
ST["cb_exit"].append(RAW())
|
|
294
|
+
return out
|
|
295
|
+
out = tr(*x, callback=cb, **kw)
|
|
296
|
+
ST["train_exit"] = RAW()
|
|
297
|
+
return out
|
|
298
|
+
algo.train = train
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
def wrap_dry(algo, epochs, n):
|
|
302
|
+
"""TW14_DRY_EPOCHS=N (the review 11-12, the cell runner's dry start inside the claim, for a cell whose key has no certificate): the
|
|
303
|
+
cell's own command at its PRODUCTION epoch count, stopped after the suite's callback for epoch N returns. cfg.epochs and SapoVec's
|
|
304
|
+
max_epochs stay the run's, so every schedule and assert keyed on them is the run's (A13c died at epoch 1's callback on
|
|
305
|
+
SUITE_SAVE_CKPTS_EVERY % (epochs // 50); a smoke at a smaller epoch count passes that assert). Start-up, the first N updates and the
|
|
306
|
+
suite's per-epoch callback run; then the CUDA device is synchronised (an asynchronous kernel fault raises here, rc != 0) and the
|
|
307
|
+
process leaves with os._exit(0): no atexit (the stamps), no final eval, no checkpoint past what the callback itself saved (so the
|
|
308
|
+
caller gives it an --out-dir of its own).
|
|
309
|
+
Under the captured window (mode "graph") the dry start must reach the FIRST REPLAY (the review, 11-12): tonight's taskwalk windows
|
|
310
|
+
read {eager 3, graph 5}, so the first replay is epoch index 3 (N = 4), where the g999 died (an illegal memory access right after
|
|
311
|
+
the record) and where A11c / A14's gate differences enter. A replayed epoch is tw1_gate_gpu's own test (W.graphs is not None at the
|
|
312
|
+
epoch's callback); with none by epoch N the dry start fails (rc != 0) instead of passing a path it never ran."""
|
|
313
|
+
assert 1 <= n < epochs, f"TW14_DRY_EPOCHS={n} must be in [1, the run's {epochs} epochs)"
|
|
314
|
+
tr, need_replay, rep = algo.train, TW1["on"] and TW1.get("window_mode", "graph") == "graph", []
|
|
315
|
+
|
|
316
|
+
def train(*x, callback=None, **kw):
|
|
317
|
+
def cb(epoch, step_count, *r, **k):
|
|
318
|
+
out = callback(epoch, step_count, *r, **k) if callback is not None else None
|
|
319
|
+
W = TW1["W"]
|
|
320
|
+
if W is not None and W.graphs is not None:
|
|
321
|
+
rep.append(epoch + 1)
|
|
322
|
+
if epoch + 1 == n:
|
|
323
|
+
torch.cuda.synchronize()
|
|
324
|
+
assert rep or not need_replay, (f"TW14_DRY_EPOCHS={n}: no replayed window by epoch {n} under the captured window; the dry "
|
|
325
|
+
f"start must reach the first replay (raise N)")
|
|
326
|
+
win = dict(W.windows) if W is not None else None # the review: the window counts and the
|
|
327
|
+
pool = W.pool.n_builds if W is not None and W.pool is not None else None # pool's builds, so a pass shows the pool replayed
|
|
328
|
+
print(f"[tw14] dry epochs: {n} of {epochs} done (steps {int(step_count)}, replayed epochs {rep or 'none'}, windows {win}, "
|
|
329
|
+
f"reset pool builds {pool}, {RAW() - T_IMPORT:.1f} s after the import); exit 0", flush=True)
|
|
330
|
+
sys.stderr.flush()
|
|
331
|
+
os._exit(0)
|
|
332
|
+
return out
|
|
333
|
+
return tr(*x, callback=cb, **kw)
|
|
334
|
+
algo.train = train
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
def wrap_log_cmd(algo, env, epochs):
|
|
338
|
+
"""--tw1-log-cmd (11-11, after RUN290's frozen ramp): at every logged epoch (the suite's rule: the first, every epochs // 50, the
|
|
339
|
+
last) the command the env actually holds and the speed price the reward actually uses, read off the live objects: env._train_steps,
|
|
340
|
+
the floor / ceiling TW_V_LO / TW_V_HI, the worlds' v_tgt (mean, min, max) and taskwalk.w_speed_max. One host read per logged epoch, so
|
|
341
|
+
the eager loop only (refused under --tw1-capture, whose Python-side schedules are frozen: tools/d16_taskwalk/PREREG_RUN350.md Amendment 1)."""
|
|
342
|
+
tr, tw, every = algo.train, env.taskwalk, max(1, epochs // 50)
|
|
343
|
+
|
|
344
|
+
def train(*x, callback=None, **kw):
|
|
345
|
+
def cb(epoch, step_count, *r, **k):
|
|
346
|
+
out = callback(epoch, step_count, *r, **k) if callback is not None else None
|
|
347
|
+
if epoch == 0 or (epoch + 1) % every == 0 or epoch + 1 == epochs:
|
|
348
|
+
v = tw.v_tgt.detach().float()
|
|
349
|
+
print(f"[tw14] cmd ep={epoch + 1} train_steps={env._train_steps} floor={env.TW_V_LO:.5f} ceiling={env.TW_V_HI:.5f} "
|
|
350
|
+
f"v_tgt mean={float(v.mean()):.5f} min={float(v.min()):.5f} max={float(v.max()):.5f} w_speed_max={float(tw.w_speed_max):.5f}",
|
|
351
|
+
flush=True)
|
|
352
|
+
return out
|
|
353
|
+
return tr(*x, callback=cb, **kw)
|
|
354
|
+
algo.train = train
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
def wrap_log_weights(algo, env, epochs):
|
|
358
|
+
"""--tw1-log-weights (11-11, PREREG_S290 Amendment 2, S290 from a cold start): at every logged epoch (the suite's rule, as
|
|
359
|
+
--tw1-log-cmd) the schedules the env holds (the TASKWALK_W_* list and its second segments, the command's floor / ceiling ends) and
|
|
360
|
+
the weights the reward multiplies by: the four that R290's recipe ramps (joint limit, passive limit torque, hip rotation, head
|
|
361
|
+
acceleration) and the speed price, each read off the live reward (a weight with a tensor route through that tensor, which is what
|
|
362
|
+
the captured graph reads). Allowed under --tw1-capture: it reads values, it writes nothing, and with no schedule nothing writes them."""
|
|
363
|
+
tr, tw, every = algo.train, env.taskwalk, max(1, epochs // 50)
|
|
364
|
+
names = ("w_joint_limit", "w_limit_torque", "w_hip_rotation", "w_head_accel", "w_speed_max")
|
|
365
|
+
|
|
366
|
+
def val(n):
|
|
367
|
+
wt = getattr(tw, "_wt", None)
|
|
368
|
+
return float(wt[n]) if wt is not None and n in wt else float(getattr(tw, n))
|
|
369
|
+
|
|
370
|
+
def train(*x, callback=None, **kw):
|
|
371
|
+
def cb(epoch, step_count, *r, **k):
|
|
372
|
+
out = callback(epoch, step_count, *r, **k) if callback is not None else None
|
|
373
|
+
if epoch == 0 or (epoch + 1) % every == 0 or epoch + 1 == epochs:
|
|
374
|
+
print(f"[tw14] weights ep={epoch + 1} w_sched {len(env._tw_w_sched)} w_sched2 {len(getattr(env, '_tw_w_sched2', []))} "
|
|
375
|
+
f"v_lo_end {env._tw_v_lo_end} v_hi_end {env._tw_v_hi_end} floor={env.TW_V_LO:.5f} ceiling={env.TW_V_HI:.5f} "
|
|
376
|
+
+ " ".join(f"{n}={val(n):.6g}" for n in names), flush=True)
|
|
377
|
+
return out
|
|
378
|
+
return tr(*x, callback=cb, **kw)
|
|
379
|
+
algo.train = train
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
def install_tw1(algo, env, e14):
|
|
383
|
+
"""--tw1-capture: SAPO's actor window as P3's per-slot CUDA graphs on the taskwalk env (TW1 S2a, tools/d16_taskwalk/TW1_S2_DESIGN.md;
|
|
384
|
+
its GPU gate tw1_gate_gpu.py): the window-varying weights through their tensor route, the speed P update at the window boundary,
|
|
385
|
+
extra_state = sapo_capture.TASKWALK_STATE. Bitwise to the eager loop by that gate."""
|
|
386
|
+
from diffneusim.rl import sapo_capture as SC
|
|
387
|
+
tw = env.taskwalk
|
|
388
|
+
names = sorted({n for n, *_ in env._tw_w_sched} | {n for n, *_ in getattr(env, "_tw_w_sched2", [])} | {"w_speed_max"}
|
|
389
|
+
| ({env._asat_gate["target"]} if getattr(env, "_asat_gate", None) is not None else set())) # the performance-gated weight moves between windows
|
|
390
|
+
tw.enable_tensor_weights(names, env.device)
|
|
391
|
+
if tw._speed_p is not None:
|
|
392
|
+
tw.defer_speed_p()
|
|
393
|
+
TW1["W"] = SC.install(algo, env, e14, TW1.get("window_mode", "graph"), extra_state=SC.TASKWALK_STATE, pool=TW1["pool"]) # --tw1-pool: S2b, the reset pool; --tw1-window-eager: mode "eager"
|
|
394
|
+
if TW1["W"].pool is not None: # the pool's device counters, printed at exit (L290p, 11-10, ran without this print)
|
|
395
|
+
P = TW1["W"].pool
|
|
396
|
+
atexit.register(lambda: print(f"[tw14] reset pool: {P.n_builds} builds, {int(P.resets)} resets, {int(P.reused)} of them a second reset of a world in its window (the row reused)", flush=True))
|
|
397
|
+
print(f"[tw14] TW1 S2a capture installed: SapoWindow {TW1['W'].mode}, extra_state {len(TW1['W'].extra)} paths, tensor weights {names}", flush=True)
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
def install_freeze(algo, obs_rms, alpha):
|
|
401
|
+
"""TW14_FREEZE_OBS_RMS=1 / TW14_FREEZE_ALPHA=1 (opt-in; 11-12 for the review's sprint diagnostic, PREREG_TENDON Amendment 11; unset =
|
|
402
|
+
today's path: this is never called). obs_rms: the observation normaliser is not updated during training. alpha: the temperature takes no
|
|
403
|
+
optimiser step. Both are no-ops set on the INSTANCE (algo.obs_rms.update, algo.alpha_opt.step) BEFORE the capture is installed, so the eager
|
|
404
|
+
loop, the captured window (sapo_capture's obs_rms.update calls run as no-ops while it records) and E5's text-copied _e5_update_alpha (which
|
|
405
|
+
calls self.alpha_opt.step()) all skip them, and the flag is constant for the whole run. A warm start's loaded mean / var / count and
|
|
406
|
+
log_alpha stay as loaded: train() records them at entry and asserts them BITWISE at exit (fail-fast)."""
|
|
407
|
+
assert obs_rms or alpha
|
|
408
|
+
if obs_rms:
|
|
409
|
+
algo.obs_rms.update = lambda arr: None
|
|
410
|
+
if alpha:
|
|
411
|
+
assert hasattr(algo, "alpha_opt") and hasattr(algo, "log_alpha"), "TW14_FREEZE_ALPHA needs SAPO's temperature"
|
|
412
|
+
algo.alpha_opt.step = lambda *a, **k: None
|
|
413
|
+
tr = algo.train
|
|
414
|
+
|
|
415
|
+
def train(*x, **kw):
|
|
416
|
+
r = algo.obs_rms
|
|
417
|
+
m0, v0, c0 = r.mean.clone(), r.var.clone(), r.count
|
|
418
|
+
la0 = algo.log_alpha.detach().clone() if alpha else None
|
|
419
|
+
print(f"[tw14] FROZEN for this run: obs_rms {obs_rms} (count {c0:.6g}), alpha {alpha}"
|
|
420
|
+
+ (f" (alpha {float(la0.exp()):.4g})" if alpha else ""), flush=True)
|
|
421
|
+
out = tr(*x, **kw)
|
|
422
|
+
if obs_rms:
|
|
423
|
+
assert torch.equal(r.mean, m0) and torch.equal(r.var, v0) and r.count == c0, "the frozen obs_rms moved"
|
|
424
|
+
if alpha:
|
|
425
|
+
assert torch.equal(algo.log_alpha.detach(), la0), "the frozen log_alpha moved"
|
|
426
|
+
print(f"[tw14] FROZEN check at train exit: obs_rms {'bitwise unchanged' if obs_rms else 'not frozen'}, "
|
|
427
|
+
f"alpha {'bitwise unchanged' if alpha else 'not frozen'}", flush=True)
|
|
428
|
+
return out
|
|
429
|
+
algo.train = train
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
def install_lr_sched(algo, spec):
|
|
433
|
+
"""TW14_LR_SCHED (opt-in; 11-12 for the review's step-size diagnostic; unset = the suite's linear anneal, bit-identical): the actor and
|
|
434
|
+
critic learning rates set per epoch here instead of SapoVec.train's "linear" rewrite (lr_schedule switched off). The optimizer step runs in
|
|
435
|
+
Python after the captured window's backward, so a per-epoch change takes effect under capture as the linear anneal does.
|
|
436
|
+
const both held at their configured values (DN_ACTOR_LR / DN_CRITIC_LR, or SAPO's defaults) for every epoch
|
|
437
|
+
floor:FRAC:EPOCH linear from the configured peak to FRAC x peak at absolute epoch EPOCH, then held at FRAC x peak
|
|
438
|
+
The epoch is ABSOLUTE (a warm start's epoch_offset added), so a continuation keeps its place in the schedule."""
|
|
439
|
+
parts = spec.split(":")
|
|
440
|
+
assert parts[0] in ("const", "floor") and (len(parts) == 1 if parts[0] == "const" else len(parts) == 3), f"TW14_LR_SCHED={spec!r}"
|
|
441
|
+
frac, e_floor = (float(parts[1]), int(parts[2])) if parts[0] == "floor" else (1.0, 1)
|
|
442
|
+
assert 0.0 < frac <= 1.0 and e_floor >= 1, spec
|
|
443
|
+
assert algo.lr_schedule == "linear", algo.lr_schedule
|
|
444
|
+
algo.lr_schedule = "tw14"
|
|
445
|
+
peak_a, peak_c, sc = float(algo.actor_lr), float(algo.critic_lr), float(getattr(algo, "_actor_lr_scale", 1.0))
|
|
446
|
+
|
|
447
|
+
def factor(e):
|
|
448
|
+
return 1.0 + (frac - 1.0) * min(1.0, e / e_floor)
|
|
449
|
+
|
|
450
|
+
def set_lr(e):
|
|
451
|
+
f = factor(e)
|
|
452
|
+
for g in algo.actor_opt.param_groups:
|
|
453
|
+
g["lr"] = peak_a * f * sc
|
|
454
|
+
for g in algo.critic_opt.param_groups:
|
|
455
|
+
g["lr"] = peak_c * f
|
|
456
|
+
return f
|
|
457
|
+
|
|
458
|
+
tr = algo.train
|
|
459
|
+
|
|
460
|
+
def train(*x, callback=None, **kw):
|
|
461
|
+
off = int(getattr(algo, "epoch_offset", 0))
|
|
462
|
+
f0 = set_lr(off)
|
|
463
|
+
print(f"[tw14] lr schedule {spec}: peaks actor {peak_a:.3g} critic {peak_c:.3g}; epoch {off} factor {f0:.4f} "
|
|
464
|
+
f"(actor {peak_a * f0 * sc:.3g}, critic {peak_c * f0:.3g})", flush=True)
|
|
465
|
+
|
|
466
|
+
def cb(epoch, step_count, *r, **k):
|
|
467
|
+
out = callback(epoch, step_count, *r, **k) if callback is not None else None
|
|
468
|
+
f = set_lr(off + epoch + 1) # the next epoch's rate, set before its window
|
|
469
|
+
if (epoch + 1) % 200 == 0:
|
|
470
|
+
print(f"[tw14] lr at epoch {off + epoch + 1}: factor {f:.4f} actor {peak_a * f * sc:.3g} critic {peak_c * f:.3g}", flush=True)
|
|
471
|
+
return out
|
|
472
|
+
return tr(*x, callback=cb, **kw)
|
|
473
|
+
algo.train = train
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
def wrap_first_update(algo):
|
|
477
|
+
"""the launch campaign's measure (23 for the review, 11-11): ONE line per process at the end of its first training epoch (the first after
|
|
478
|
+
a resume too), outside any clock, a print only: FIRST_UPDATE <local time with offset> it=<the epoch's number>"""
|
|
479
|
+
tr, done = algo.train, {"v": False}
|
|
480
|
+
|
|
481
|
+
def train(*x, callback=None, **kw):
|
|
482
|
+
def cb(epoch, step_count, *r, **k):
|
|
483
|
+
out = callback(epoch, step_count, *r, **k) if callback is not None else None
|
|
484
|
+
if not done["v"]:
|
|
485
|
+
done["v"] = True
|
|
486
|
+
print(f"FIRST_UPDATE {time.strftime('%Y-%m-%dT%H:%M:%S%z')} it={epoch + 1}", flush=True)
|
|
487
|
+
return out
|
|
488
|
+
return tr(*x, callback=cb, **kw)
|
|
489
|
+
algo.train = train
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
def make_algo(name, env, cfg, seed):
|
|
493
|
+
algo = orig_make_algo(name, env, cfg, seed)
|
|
494
|
+
ST["algo_core"] = RAW() # the start-up split (the review 11-12: the cell's 2-3 min before epoch 1)
|
|
495
|
+
# the engine's tape window is the ALGORITHM's (DN_STEPS_NUM overrides SAPO's steps_num, not cfg's; PREREG_S290 Amendment 3's
|
|
496
|
+
# CHECK probe at H64 hit train14's 'the window's 32 control steps are used' with cfg.steps_num); equal to cfg.steps_num when unset
|
|
497
|
+
# both windows printed, and equal unless DN_STEPS_NUM is set (the review: the fix is a no-op at H32 by construction; the log shows it)
|
|
498
|
+
print(f"[tw14] engine window: algo.steps_num {int(algo.steps_num)} cfg.steps_num {int(cfg.steps_num)} DN_STEPS_NUM "
|
|
499
|
+
f"{os.environ.get('DN_STEPS_NUM', 'unset')}", flush=True)
|
|
500
|
+
if "DN_STEPS_NUM" not in os.environ:
|
|
501
|
+
assert int(algo.steps_num) == int(cfg.steps_num), (algo.steps_num, cfg.steps_num)
|
|
502
|
+
e14 = install(env, int(algo.steps_num))
|
|
503
|
+
ST["e14_installed"] = RAW()
|
|
504
|
+
if EMA:
|
|
505
|
+
install_ema(algo)
|
|
506
|
+
_fz = (False, False)
|
|
507
|
+
if any(_fz):
|
|
508
|
+
install_freeze(algo, *_fz) # before the capture (install_tw1) and every train() wrapper below
|
|
509
|
+
if TW1["critic_iters"] is not None:
|
|
510
|
+
algo.critic_iterations = int(TW1["critic_iters"])
|
|
511
|
+
if TW1["tf32"]:
|
|
512
|
+
torch.backends.cuda.matmul.allow_tf32 = True
|
|
513
|
+
if TW1["m1c"]:
|
|
514
|
+
algo.critic.compile(dynamic=False) # the m1c: in place, so the bootstrap runs compiled too
|
|
515
|
+
if TW1.get("e5"):
|
|
516
|
+
algo.enable_critic_overlap() # after the critic's final form (eager or m1c in place)
|
|
517
|
+
if TW1["k2"]:
|
|
518
|
+
assert e14.foot is not None and env.mirror is not None, "--tw1-k2: the mirror latch on the D16 contact (E0_ENV14_KINLATCH)"
|
|
519
|
+
assert set(e14.foot.bodies) <= set(env._monitor._fk_moving) | set(env._tw_bodies), "the foot bodies must be in the reward's FK"
|
|
520
|
+
env._tw_latch_from_reward = True
|
|
521
|
+
assert not TW1["pool"] or TW1["on"], "--tw1-pool needs --tw1-capture (the pool lives in the SapoWindow)"
|
|
522
|
+
if TW1["on"]:
|
|
523
|
+
install_tw1(algo, env, e14)
|
|
524
|
+
ST["tw1_installed"] = RAW()
|
|
525
|
+
if TW1["log_cmd"]:
|
|
526
|
+
assert not TW1["on"], "--tw1-log-cmd reads the live Python schedules, which --tw1-capture freezes: the eager loop only"
|
|
527
|
+
wrap_log_cmd(algo, env, cfg.epochs)
|
|
528
|
+
if TW1["log_w"]:
|
|
529
|
+
wrap_log_weights(algo, env, cfg.epochs)
|
|
530
|
+
if os.environ.get("TW14_LR_SCHED"):
|
|
531
|
+
install_lr_sched(algo, os.environ["TW14_LR_SCHED"]) # before the stamps wrapper, inside the suite's callback
|
|
532
|
+
wrap_first_update(algo)
|
|
533
|
+
if TW1["stamps"]:
|
|
534
|
+
wrap_train(algo) # around whatever train() the installs left
|
|
535
|
+
if DRY:
|
|
536
|
+
wrap_dry(algo, int(cfg.epochs), DRY) # last: its exit follows the stamps' callback for epoch N
|
|
537
|
+
print(f"[tw14] TW1 switches: k2 {TW1['k2']} capture {TW1['on']} m1c {TW1['m1c']} tf32 {bool(torch.backends.cuda.matmul.allow_tf32)} critic_iterations "
|
|
538
|
+
f"{algo.critic_iterations} freeze_critic_bptt {algo.freeze_critic_bptt} one_bootstrap {algo.one_bootstrap}; no_final_eval "
|
|
539
|
+
f"{TW1['no_final_eval']} stamps {TW1['stamps']} pool {TW1['pool']}", flush=True)
|
|
540
|
+
ST["algo_built"] = RAW()
|
|
541
|
+
return algo
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
orig_make_env = S.make_env
|
|
545
|
+
MADE = {"n": 0}
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
def make_env(name, cfg, seed, stochastic_init):
|
|
549
|
+
"""the suite's make_env (two call sites, rl_algorithm_suite.py train_one) with env14 installed on every env after the first. The first
|
|
550
|
+
is the training env, which make_algo installs. The second is the suite's end-of-run eval env (after algo.train). It ran the D16-trained
|
|
551
|
+
policy on the old engine (the reviewer's H2), and now runs on the D16 engine too, so old_sim 0 holds for the whole process."""
|
|
552
|
+
if MADE["n"] >= 1 and TW1["no_final_eval"]:
|
|
553
|
+
assert ST["train_exit"] is not None or not TW1["stamps"], "--tw1-no-final-eval: a second env before train() returned"
|
|
554
|
+
MADE["n"] += 1
|
|
555
|
+
return None # the suite's eval env: not built (eval_and_record below takes None)
|
|
556
|
+
env = orig_make_env(name, cfg, seed, stochastic_init)
|
|
557
|
+
MADE["n"] += 1
|
|
558
|
+
if MADE["n"] == 1:
|
|
559
|
+
ST["env_built"] = RAW()
|
|
560
|
+
if MADE["n"] > 1:
|
|
561
|
+
env._tw_e14 = install(env, cfg.steps_num)
|
|
562
|
+
return env
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
orig_eval_and_record = S.eval_and_record
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
def eval_and_record(env_name, env, algo, out_npz, *x, **kw):
|
|
569
|
+
"""the suite's end-of-run eval, timed (RAW); skipped under --tw1-no-final-eval (its env was not built)"""
|
|
570
|
+
t = RAW()
|
|
571
|
+
if TW1["no_final_eval"]:
|
|
572
|
+
assert env is None and MADE["n"] == 2, (env, MADE)
|
|
573
|
+
out = dict(eval_return=float("nan"), eval_steps=0, eval_fwd=float("nan"), eval_height_mean=float("nan"), rollout_dnrec="",
|
|
574
|
+
final_eval_skipped=True)
|
|
575
|
+
else:
|
|
576
|
+
out = orig_eval_and_record(env_name, env, algo, out_npz, *x, **kw)
|
|
577
|
+
ST["final_eval_s"] = RAW() - t
|
|
578
|
+
print(f"[tw14] the suite's final eval: {'skipped (--tw1-no-final-eval)' if TW1['no_final_eval'] else 'ran'}, {ST['final_eval_s']:.1f} s "
|
|
579
|
+
f"(RAW)", flush=True)
|
|
580
|
+
return out
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
orig_write_run_config = S.write_run_config
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
def write_run_config(out_dir, env, algo, *x, **kw):
|
|
587
|
+
"""the suite's run_config, plus TW1's capture record (the argument is stripped from the argv the suite sees)"""
|
|
588
|
+
orig_write_run_config(out_dir, env, algo, *x, **kw)
|
|
589
|
+
p = pathlib.Path(out_dir) / "run_config.json"
|
|
590
|
+
r = json.loads(p.read_text())
|
|
591
|
+
W = TW1["W"]
|
|
592
|
+
r["tw1_capture"] = dict(on=TW1["on"], mode=W.mode if W is not None else None, extra_state=list(W.extra) if W is not None else None,
|
|
593
|
+
m1c=TW1["m1c"], k2=TW1["k2"], tf32=bool(torch.backends.cuda.matmul.allow_tf32), critic_iterations=int(algo.critic_iterations),
|
|
594
|
+
freeze_critic_bptt=bool(algo.freeze_critic_bptt), one_bootstrap=algo.one_bootstrap,
|
|
595
|
+
no_final_eval=TW1["no_final_eval"], stamps=TW1["stamps"], pool=TW1["pool"], e5=TW1.get("e5", False))
|
|
596
|
+
p.write_text(json.dumps(r, indent=2))
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
orig_payload = S.ckpt_payload
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
def ckpt_payload(algo, step_count, epoch):
|
|
603
|
+
p = orig_payload(algo, step_count, epoch)
|
|
604
|
+
if getattr(algo, "_learn_ema", None): # the shadow beside the raw weights (once built); the normalizer stays the raw policy's
|
|
605
|
+
p["actor_ema"] = {k: v.clone() for k, v in algo._learn_ema.items()}
|
|
606
|
+
# D16_TW_CHAIN=GCOT (11-22): the checkpoint's "epoch" is the ABSOLUTE epoch (the warm start's epoch_offset + this run's local epoch). The
|
|
607
|
+
# suite stores the local epoch, which a chain link reads as its epoch_offset and its env step counter (SUITE_INIT_RESUME_ENV_STEPS), so a
|
|
608
|
+
# second link would restart the lr anneal and the command schedule at its parent's local count; eval_tw14 also holds the scheduled weights
|
|
609
|
+
# at this epoch. The local epoch is kept as "epoch_local"; the file name stays local (the suite's).
|
|
610
|
+
if os.environ.get("D16_TW_CHAIN") == "GCOT":
|
|
611
|
+
p["epoch_local"] = int(epoch)
|
|
612
|
+
p["epoch"] = int(epoch) + int(getattr(algo, "epoch_offset", 0))
|
|
613
|
+
return p
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
if __name__ == "__main__":
|
|
617
|
+
_av, _out = sys.argv[1:], []
|
|
618
|
+
while _av:
|
|
619
|
+
x = _av.pop(0)
|
|
620
|
+
if x == "--tw1-capture":
|
|
621
|
+
TW1["on"] = True
|
|
622
|
+
elif x == "--tw1-eager": # debugging only: the eager loop on CUDA
|
|
623
|
+
TW1["on"], TW1["pool"] = False, False
|
|
624
|
+
elif x == "--tw1-m1c":
|
|
625
|
+
TW1["m1c"] = True
|
|
626
|
+
elif x == "--tw1-tf32":
|
|
627
|
+
TW1["tf32"] = True
|
|
628
|
+
elif x == "--tw1-k2":
|
|
629
|
+
TW1["k2"] = True
|
|
630
|
+
elif x == "--tw1-e5": # the critic on a side stream during the actor's backward (was e5_launch.py --e5 1)
|
|
631
|
+
TW1["e5"] = True
|
|
632
|
+
elif x == "--tw1-critic-iters":
|
|
633
|
+
TW1["critic_iters"] = int(_av.pop(0))
|
|
634
|
+
elif x == "--tw1-pool":
|
|
635
|
+
TW1["pool"] = True
|
|
636
|
+
elif x == "--tw1-window-eager": # 23 for the review 11-12 (A14's waiver): the SapoWindow in mode "eager" with its pool,
|
|
637
|
+
TW1["window_mode"] = "eager" # i.e. tw1_gate_gpu's eagerx arm as the training path (the reference the gate compares to)
|
|
638
|
+
elif x == "--tw1-no-pool": # the captured window WITHOUT the reset pool (S2a alone: L290s, S290's cells)
|
|
639
|
+
TW1["pool"] = False
|
|
640
|
+
elif x == "--tw1-no-final-eval":
|
|
641
|
+
TW1["no_final_eval"] = True
|
|
642
|
+
elif x == "--tw1-log-cmd":
|
|
643
|
+
TW1["log_cmd"] = True
|
|
644
|
+
elif x == "--tw1-log-weights":
|
|
645
|
+
TW1["log_w"] = True
|
|
646
|
+
elif x == "--tw1-stamps":
|
|
647
|
+
TW1["stamps"] = _av.pop(0)
|
|
648
|
+
else:
|
|
649
|
+
_out.append(x)
|
|
650
|
+
sys.argv = sys.argv[:1] + _out
|
|
651
|
+
assert not (TW1["pool"] and not TW1["on"]), "the reset pool needs the captured window (--tw1-pool without --tw1-capture, or --tw1-eager with --tw1-pool)"
|
|
652
|
+
# the resolved loop, printed before anything else (run_config.json["tw1_capture"] records the same switches at the run's end); since
|
|
653
|
+
# the default flip (ebc2c712a) a command without loop flags runs capture + pool on CUDA, so a record states which loop produced it
|
|
654
|
+
LOOP = dict(backend=os.environ.get("E0_ENV14_BACKEND", "cuda"), capture=TW1["on"], window=TW1.get("window_mode", "graph"), pool=TW1["pool"], k2=TW1["k2"], tf32=TW1["tf32"],
|
|
655
|
+
m1c=TW1["m1c"], critic_iters=TW1["critic_iters"], e5=TW1.get("e5", False))
|
|
656
|
+
print("[tw14] loop: " + " ".join(f"{k} {v}" for k, v in LOOP.items()), flush=True)
|
|
657
|
+
if os.environ.get("TW14_PARSE_ONLY") == "1": # the caller census (PREREG_CAPSCHED's pin check): the parse alone, nothing built
|
|
658
|
+
print("[tw14] parse-only " + json.dumps(LOOP), flush=True)
|
|
659
|
+
sys.exit(0)
|
|
660
|
+
DRY = int(os.environ.get("TW14_DRY_EPOCHS", "0")) # wrap_dry: 0 (unset) = the full run
|
|
661
|
+
assert DRY >= 0, DRY
|
|
662
|
+
if DRY:
|
|
663
|
+
print(f"[tw14] dry epochs {DRY}: the run's own command and epoch count, stopped after epoch {DRY}'s callback", flush=True)
|
|
664
|
+
check_env()
|
|
665
|
+
if TW1["stamps"]:
|
|
666
|
+
atexit.register(write_stamps)
|
|
667
|
+
S.make_algo = make_algo
|
|
668
|
+
S.make_env = make_env
|
|
669
|
+
S.eval_and_record = eval_and_record
|
|
670
|
+
S.ckpt_payload = ckpt_payload
|
|
671
|
+
S.write_run_config = write_run_config
|
|
672
|
+
sys.argv = ["diffneusim.train.rl_algorithm_suite"] + sys.argv[1:]
|
|
673
|
+
S.main()
|
|
674
|
+
|