hyperdrone 0.1.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.
- hyperdrone/__init__.py +28 -0
- hyperdrone/_native/cmake/hyperdrone_jit.cmake +43 -0
- hyperdrone/_native/common/bindings.h +39 -0
- hyperdrone/_native/common/cuda_staging.h +68 -0
- hyperdrone/_native/common/jit_host.h +69 -0
- hyperdrone/_native/dynamics/CMakeLists.txt +66 -0
- hyperdrone/_native/dynamics/host.cpp +191 -0
- hyperdrone/_native/dynamics/iface.h +81 -0
- hyperdrone/_native/dynamics/impl.cpp +659 -0
- hyperdrone/_native/render/CMakeLists.txt +96 -0
- hyperdrone/_native/render/host.cpp +276 -0
- hyperdrone/_native/render/iface.h +132 -0
- hyperdrone/_native/render/impl.cpp +620 -0
- hyperdrone/_native/render/scene_bindings.cpp +279 -0
- hyperdrone/_vendor/rl-tools/CMakeLists.txt +159 -0
- hyperdrone/_vendor/rl-tools/LICENSE +21 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/all.cmake +14 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/git-diff.cmake +103 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/git-hash.cmake +13 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier1-blas.cmake +43 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier2-json-hdf5-zlib.cmake +84 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier3-tensorboard.cmake +29 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier4-cuda.cmake +33 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier5-cli11.cmake +26 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/assimp_fixup.cmake +16 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/googletest.cmake +17 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/metal.cmake +27 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/mujoco.cmake +32 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/optix.cmake +17 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/raytracing_generic.cmake +4 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/vulkan.cmake +6 -0
- hyperdrone/_vendor/rl-tools/cmake/scripts/embed_text.cmake +7 -0
- hyperdrone/_vendor/rl-tools/cmake/scripts/generate-git-snapshot.cmake +138 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/matrix.h +143 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_arm.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu.h +314 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_accelerate.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_blas.h +67 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_mkl.h +38 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_openblas.h +34 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cuda.h +289 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_dummy.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_esp32.h +29 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_generic.h +946 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_wasm32.h +13 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/persist_code.h +136 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_arm.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu.h +94 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_accelerate.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_blas.h +115 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_mkl.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_openblas.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cuda.h +703 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_generic.h +1334 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/persist_code.h +130 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/tensor.h +490 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/arm.h +91 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu.h +205 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_accelerate.h +23 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_blas.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_mkl.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_openblas.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_tensorboard.h +34 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cuda.h +411 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/devices.h +92 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/dummy.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/esp32.h +85 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/generic.h +0 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/wasm32.h +59 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/model.h +218 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/operations_generic.h +771 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/persist.h +278 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/policy_adapter.h +100 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/policy_adapter_persist.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/tensor_operations_generic.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/c_backend.h +112 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/c_interface.h +36 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/l2f.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/operations_dyn.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/operations_generic.h +268 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/debugging_pool/c_backend.h +31 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/debugging_pool/c_interface.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/c_backend.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/c_interface.h +50 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/executor.h +133 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/helper.h +109 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/operations_generic.h +219 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_arduino.h +117 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_arm.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_cpu.h +93 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_cpu_tensorboard.h +151 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_cuda.h +65 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_dummy.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_wasm32.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_arm.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_cpu.h +139 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_cuda.h +382 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_dummy.h +93 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_esp32.h +92 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_generic.h +297 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_wasm32.h +225 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/mode/mode.h +75 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/activation_functions.h +115 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/capability/capability.h +63 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/capability/persist_code.h +27 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/layer.h +122 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/operations_cuda.h +64 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/operations_generic.h +184 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/persist.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/layer.h +300 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/operations_cpu_mkl.h +590 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/operations_cuda.h +739 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/operations_generic.h +1185 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/persist.h +99 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/persist_code.h +170 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/layer.h +145 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_arm/dsp.h +63 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_arm/opt.h +173 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu.h +13 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_accelerate.h +66 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_blas.h +282 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_mkl.h +66 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_openblas.h +65 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cuda.h +519 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_dummy.h +8 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_esp32/dsp.h +58 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_esp32/opt.h +167 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_generic.h +421 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/persist.h +62 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/persist_code.h +178 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/persist_common.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/layer.h +188 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/operations_cuda.h +356 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/operations_generic.h +534 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/persist.h +32 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/embedding/layer.h +119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/embedding/operations_generic.h +217 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/embedding/persist.h +46 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/layer.h +121 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/operations_generic.h +152 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/persist.h +44 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/persist_code.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/helper_operations_cuda.h +375 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/helper_operations_generic.h +158 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/layer.h +218 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/operations_generic.h +947 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/persist.h +75 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/persist_code.h +199 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/layers.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/layer.h +143 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/operations_cuda.h +80 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/operations_generic.h +214 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/persist.h +39 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_accelerate.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_blas.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_mkl.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_openblas.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cuda.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_dummy.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_generic.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/layer.h +223 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/operations_cuda.h +138 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/operations_generic.h +428 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/persist.h +70 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/layer.h +154 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/operations_cuda.h +119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/operations_generic.h +494 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/persist.h +50 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/persist_code.h +173 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/layer.h +116 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/operations_cuda.h +156 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/operations_generic.h +291 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/persist.h +83 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/persist_code.h +163 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/layer.h +123 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/operations_generic.h +268 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/persist.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/persist_code.h +164 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/layer.h +122 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/operations_cuda.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/operations_generic.h +158 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/persist.h +47 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/persist_code.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/upsample2d/layer.h +132 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/upsample2d/operations_cuda.h +141 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/upsample2d/operations_generic.h +228 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/categorical_cross_entropy/operations_generic.h +102 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/mse/operations_cuda.h +97 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/mse/operations_generic.h +101 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/operations_generic.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/nn.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_accelerate.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_blas.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_mkl.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_mux.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_openblas.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cuda.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_dummy.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_generic.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/adam.h +120 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/operations_cuda.h +90 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/operations_generic.h +144 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/persist.h +39 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/persist_code.h +79 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/operations_cuda.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/operations_generic.h +102 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/persist.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/lamb/instance/operations_generic.h +101 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/lamb/lamb.h +40 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/lamb/operations_generic.h +61 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/optimizers.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/operations_cuda.h +77 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/operations_generic.h +134 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/persist.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/persist_code.h +71 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/operations_cuda.h +40 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/operations_generic.h +43 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/sgd.h +91 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/operations_cuda.h +0 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/operations_generic.h +90 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/parameters.h +78 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/persist.h +34 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/persist_code.h +133 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/persist.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/persist_code.h +27 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/network.h +174 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/operations_cuda.h +10 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/operations_dummy.h +8 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/operations_generic.h +381 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/persist.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/persist_code.h +137 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/network.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/operations_generic.h +76 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/persist.h +43 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/persist_code.h +135 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/models.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/model.h +148 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/operations_generic.h +280 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/persist.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/persist_code.h +71 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_cpu.h +0 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_cuda.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_dummy.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_generic.h +6 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/model.h +276 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/operations_cuda.h +165 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/operations_generic.h +571 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/persist.h +80 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/persist_code.h +196 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/persist.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/persist_code.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/random_uniform/model.h +43 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/random_uniform/operations_generic.h +73 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/resnet/resnet.h +97 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/model.h +256 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/operations_generic.h +564 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/persist.h +99 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/persist_code.h +107 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/bf16.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/categories.h +22 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/persist_code.h +54 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/policy.h +48 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm/group_1.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm/group_2.h +14 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm/group_3.h +14 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl/group_1.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mux.h +148 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda/group_1.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda/group_3.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy/group_1.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy/group_3.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32/group_3.h +13 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32/group_1.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32/group_3.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/hdf5/hdf5.h +54 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/hdf5/operations_cpu.h +419 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/io.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/operations_cpu.h +58 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/operations_generic.h +620 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/operations_posix.h +63 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/tar.h +74 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/code.h +38 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_arm.h +39 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_cpu.h +61 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_cuda.h +164 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_dummy.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_esp32.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_generic.h +133 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_generic_array.h +64 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_wasm32.h +57 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/persist.h +77 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/README.md +149 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/generic/operations_cpu.h +768 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/generic/operations_generic.h +1173 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/metal/context.h +177 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/metal/device_source.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/metal/operations_cpu.h +1122 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/device.h +212 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/device_impl.h +934 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/operations_cuda.h +1678 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/overlay_accel.h +57 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/vulkan/context.h +220 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/vulkan/device_source.h +40 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/vulkan/operations_cpu.h +1967 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/operations_cpu_common.h +1986 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/operations_cpu_mux.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/renderer.h +376 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/scene/procthor/operations_cpu.h +226 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/scene/procthor/scene.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/scene/scene.h +31 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/scene.h +107 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/transforms_generic.h +159 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/types.h +39 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/algorithms.h +6 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/operations_cpu.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/operations_cpu_mkl.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/operations_generic.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/config.h +240 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/operations_cuda.h +62 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/operations_generic.h +245 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/persist.h +102 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/state.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/operations_cuda.h +193 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/operations_generic.h +334 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/operations_generic_extensions.h +244 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/persist.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/ppo.h +105 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/approximators_gru.h +84 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/approximators_mlp.h +61 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/config.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/operations_generic.h +193 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/state.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu_accelerate.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu_mkl.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu_mux.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cuda.h +131 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_generic.h +580 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/sac.h +151 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/approximators_gru.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/approximators_mlp.h +54 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/config.h +107 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/operations_generic.h +172 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/state.h +46 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu_accelerate.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu_mkl.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu_mux.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cuda.h +111 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_generic.h +359 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/td3.h +141 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/components.h +4 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/off_policy_runner.h +225 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cpu.h +95 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cpu_accelerate.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cpu_mkl.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cuda.h +237 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_generic.h +498 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_generic_per_env.h +112 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/on_policy_runner.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu_accelerate.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu_mkl.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cuda.h +195 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_generic.h +197 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_generic_extensions.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_generic_per_env.h +91 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/persist.h +61 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_cpu.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_cpu_accelerate.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_cpu_mkl.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_generic.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/operations_cpu.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/operations_generic.h +123 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/persist.h +57 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/replay_buffer.h +93 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/running_normalizer/operations_generic.h +76 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/running_normalizer/persist.h +31 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/running_normalizer/running_normalizer.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/operations_generic.h +58 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/scale_observations/operations_generic.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/scale_observations/wrapper.h +26 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/wrappers.h +29 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/acrobot/acrobot.h +88 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/acrobot/operations_cpu.h +152 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/acrobot/operations_generic.h +202 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/car.h +119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/operations_cpu.h +110 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/operations_generic.h +206 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/operations_json.h +59 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/track.h +23 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/ui.h +189 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/environments.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/flag/environment.h +87 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/flag/operations_cpu.h +212 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/flag/operations_generic.h +215 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/metrics.h +266 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/multirotor.h +1083 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_cpu.h +2119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_cuda.h +38 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/05_state_is_nan.h +126 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/10_sample_initial_parameters.h +228 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/20_initial_state.h +189 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/30_sample_initial_state.h +276 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/35_get_desired_state.h +63 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/40_observe.h +625 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/50_state_algebra.h +57 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/60_dynamics.h +134 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/70_post_integration.h +329 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/80_abs_diff.h +290 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic.h +369 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_helper_generic.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_multitask_generic.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_multitask_generic_forward.h +26 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/default.h +202 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/arpl.h +112 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/crazyflie.h +127 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/crazyflie_openmv.h +119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/flightmare.h +111 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/fs.h +113 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/mrs.h +110 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/soft.h +117 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/soft_rigid.h +118 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/x500_real.h +88 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/x500_sim.h +114 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/init/default.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/registry.h +90 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/default.h +64 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/reward_functions.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/squared/operations_generic.h +202 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/squared/squared.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/termination/default.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/trajectories/lissajous.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/trajectories/trajectory.h +78 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/persist_code.h +53 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/quaternion_helper.h +94 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/ui.h +180 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f_visual/multirotor_visual.h +135 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f_visual/operations_cpu.h +244 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f_visual/operations_cuda.h +180 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f_visual/operations_generic.h +149 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/memory/environment.h +69 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/memory/operations_cpu.h +46 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/memory/operations_generic.h +78 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/README.MD +5 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/ant.h +77 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/model.h +415 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/operations_cpu.h +160 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/ui.h +141 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/mujoco.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/bottleneck/bottleneck.h +113 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/bottleneck/operations_cpu.h +289 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/bottleneck/operations_generic.h +495 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/environments.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/observation.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/operations_cpu.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/operations_generic.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/operations_cpu.h +146 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/operations_generic.h +262 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/pendulum.h +197 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/ui.h +97 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/ui_xeus.h +124 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/reacher/operations_cpu.h +426 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/reacher/operations_generic.h +424 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/reacher/reacher.h +137 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/loop.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/config.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/operations_cpu.h +233 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/persist.h +30 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/state.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/config.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/operations_generic.h +47 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/persist.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/state.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/config.h +47 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/operations_generic.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/persist.h +40 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/state.h +36 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/config.h +22 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/operations_cpu.h +44 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/persist.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/state.h +26 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/config.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/operations_cpu.h +113 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/persist.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/state.h +24 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/config.h +43 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/operations_cpu.h +190 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/persist.h +30 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/state.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/steps.h +4 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/config.h +27 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/operations_cpu.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/persist.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/state.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/operations_generic.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/rl.h +5 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/evaluation/evaluation.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/evaluation/operations_cpu.h +48 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/evaluation/operations_generic.h +275 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/validation.h +269 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/validation_analysis.h +85 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl_tools.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/client.h +50 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/operations_boost.h +92 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/operations_cpu.h +174 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/operations_websocket.h +208 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/server.h +448 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/universe.h +4 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/declarations_cpu.h +13 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_arm.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_cpu.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_cuda.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_dummy.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_esp32.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_generic.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_wasm32.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/env/operations_cpu.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/env/operations_generic.h +14 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/extrack/extrack.h +129 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/extrack/operations_cpu.h +588 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/integrators.h +105 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/memcpy.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/tuple/operations_generic.h +48 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/tuple/tuple.h +149 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/typing.h +118 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/vector_operations.h +174 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/polyak/operations_cuda.h +53 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/polyak/operations_generic.h +93 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/string/operations_generic.h +201 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/zlib/operations_cpu.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/version.h +28 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/CMakeLists.txt +15 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/CMakeLists.txt +9 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/generic/CMakeLists.txt +17 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/generic/freestanding_check.cpp +113 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/metal/CMakeLists.txt +31 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/metal/device.metal +815 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/metal/metal_cpp_impl.cpp +6 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/optix/CMakeLists.txt +51 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/optix/device.cu +1 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/optix/overlay_accel.cu +275 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/vulkan/CMakeLists.txt +37 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/vulkan/device.comp +865 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/vulkan/device_spirv.cpp +34 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/CMakeLists.txt +205 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/README.md +281 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/benchmark.cpp +175 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/benchmark_dynamic.cpp +494 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix.cpp +1629 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix_physics.cu +523 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix_physics.h +37 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/CMakeLists.txt +164 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/antialiasing.cpp +213 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/drone.cpp +367 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/drone_device.cu +385 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/environment/environment.h +85 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/environment/operations_cpu.h +270 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/example.cpp +276 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/fixed_pose.cpp +218 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/interactive.cpp +866 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/make_drone_glb.py +172 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/motion_blur.cpp +232 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/render_pose_trace.cpp +1833 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/render_pose_trace_motion_blur.cpp +646 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/CMakeLists.txt +147 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/README.md +15 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/job.sbatch +28 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model.h +260 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_config.h +24 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_forward_cuda.h +397 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_operations.h +418 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_persist.h +45 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_student.h +70 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/scene.cpp +221 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/scene.h +68 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/.build-check/inference_ios.o +0 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/.build-check/libinference_ios.a +0 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/.gitignore +4 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/CMakeLists.txt +4 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Info.plist +24 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Info_ios.plist +36 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/CameraManager.swift +120 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/ContentView.swift +703 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/DatasetRecorder.swift +285 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/YawPredictorApp.swift +25 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/YawPredictor.entitlements +8 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/build.sh +66 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/build_ios.sh +133 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/generate.sh +6 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/h5_to_tar.cpp +82 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/inference.cpp +166 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/inference.h +26 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/project.yml +30 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/test_tar_vs_hdf5.cpp +173 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_cuda.cu +699 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_dataset_overlay.cpp +475 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_distill_cuda.cu +995 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_eval.cu +456 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_real_world_eval.cpp +660 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_viewer.cu +445 -0
- hyperdrone/cuda/__init__.py +78 -0
- hyperdrone/dynamics/__init__.py +22 -0
- hyperdrone/dynamics/_component.py +40 -0
- hyperdrone/dynamics/_config.py +47 -0
- hyperdrone/dynamics/_sim.py +201 -0
- hyperdrone/env/__init__.py +15 -0
- hyperdrone/env/_sampling.py +67 -0
- hyperdrone/env/_world.py +60 -0
- hyperdrone/examples/__init__.py +11 -0
- hyperdrone/examples/benchmark.py +236 -0
- hyperdrone/examples/benchmark_minimal.py +66 -0
- hyperdrone/examples/data.py +42 -0
- hyperdrone/examples/drone_flythrough.py +142 -0
- hyperdrone/examples/render_procthor.py +41 -0
- hyperdrone/jit/__init__.py +111 -0
- hyperdrone/jit/_build.py +94 -0
- hyperdrone/jit/_lock.py +23 -0
- hyperdrone/jit/_patches.py +95 -0
- hyperdrone/jit/_toolchain.py +13 -0
- hyperdrone/jit/_workspace.py +70 -0
- hyperdrone/render/__init__.py +48 -0
- hyperdrone/render/_component.py +35 -0
- hyperdrone/render/_config.py +90 -0
- hyperdrone/render/_renderer.py +306 -0
- hyperdrone/render/_scene.py +34 -0
- hyperdrone-0.1.0.dist-info/METADATA +15 -0
- hyperdrone-0.1.0.dist-info/RECORD +660 -0
- hyperdrone-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,571 @@
|
|
|
1
|
+
#include "../../version.h"
|
|
2
|
+
#if (defined(RL_TOOLS_DISABLE_INCLUDE_GUARDS) || !defined(RL_TOOLS_NN_MODELS_PARALLEL_OPERATIONS_GENERIC_H)) && (RL_TOOLS_USE_THIS_VERSION == 1)
|
|
3
|
+
#pragma once
|
|
4
|
+
#define RL_TOOLS_NN_MODELS_PARALLEL_OPERATIONS_GENERIC_H
|
|
5
|
+
|
|
6
|
+
#include "model.h"
|
|
7
|
+
#include "../sequential/operations_generic.h"
|
|
8
|
+
|
|
9
|
+
RL_TOOLS_NAMESPACE_WRAPPER_START
|
|
10
|
+
namespace rl_tools{
|
|
11
|
+
namespace nn_models::parallel{
|
|
12
|
+
namespace detail{
|
|
13
|
+
template <typename TI>
|
|
14
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _fill_tuple(utils::Tuple<TI>&){}
|
|
15
|
+
template <typename TI, typename HEAD, typename... TAIL, typename FIRST, typename... REST>
|
|
16
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _fill_tuple(utils::Tuple<TI, HEAD, TAIL...>& tuple, const FIRST& first, const REST&... rest){
|
|
17
|
+
tuple.content = first;
|
|
18
|
+
_fill_tuple(static_cast<utils::Tuple<TI, TAIL...>&>(tuple), rest...);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
template <typename FIRST, typename... REST>
|
|
23
|
+
RL_TOOLS_FUNCTION_PLACEMENT utils::Tuple<typename FIRST::SPEC::SHAPE::TI, FIRST, REST...> pack_inputs(const FIRST& first, const REST&... rest){
|
|
24
|
+
using TI = typename FIRST::SPEC::SHAPE::TI;
|
|
25
|
+
utils::Tuple<TI, FIRST, REST...> result{};
|
|
26
|
+
detail::_fill_tuple(result, first, rest...);
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 2-tensor concatenation (convenience for custom models that manage their own buffers)
|
|
31
|
+
template <typename DEVICE, typename A_SPEC, typename B_SPEC, typename OUTPUT_SPEC>
|
|
32
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _concatenate(DEVICE& device, const Tensor<A_SPEC>& a, const Tensor<B_SPEC>& b, Tensor<OUTPUT_SPEC>& output){
|
|
33
|
+
using TI = typename DEVICE::index_t;
|
|
34
|
+
using A_SHAPE = typename A_SPEC::SHAPE;
|
|
35
|
+
using B_SHAPE = typename B_SPEC::SHAPE;
|
|
36
|
+
using OUT_SHAPE = typename OUTPUT_SPEC::SHAPE;
|
|
37
|
+
constexpr TI LAST_DIM_A = get_last(A_SHAPE{});
|
|
38
|
+
constexpr TI LAST_DIM_B = get_last(B_SHAPE{});
|
|
39
|
+
constexpr TI LAST_DIM_OUT = get_last(OUT_SHAPE{});
|
|
40
|
+
static_assert(LAST_DIM_OUT == LAST_DIM_A + LAST_DIM_B);
|
|
41
|
+
constexpr TI TOTAL_A = product(A_SHAPE{});
|
|
42
|
+
constexpr TI LEADING = TOTAL_A / LAST_DIM_A;
|
|
43
|
+
for(TI i = 0; i < LEADING; i++){
|
|
44
|
+
for(TI j = 0; j < LAST_DIM_A; j++){
|
|
45
|
+
*(data(output) + i * LAST_DIM_OUT + j) = get_flat(device, a, i * LAST_DIM_A + j);
|
|
46
|
+
}
|
|
47
|
+
for(TI j = 0; j < LAST_DIM_B; j++){
|
|
48
|
+
*(data(output) + i * LAST_DIM_OUT + LAST_DIM_A + j) = get_flat(device, b, i * LAST_DIM_B + j);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
template <typename DEVICE, typename D_OUTPUT_SPEC, typename D_A_SPEC, typename D_B_SPEC>
|
|
54
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _split(DEVICE& device, const Tensor<D_OUTPUT_SPEC>& d_output, Tensor<D_A_SPEC>& d_a, Tensor<D_B_SPEC>& d_b){
|
|
55
|
+
using TI = typename DEVICE::index_t;
|
|
56
|
+
using A_SHAPE = typename D_A_SPEC::SHAPE;
|
|
57
|
+
using B_SHAPE = typename D_B_SPEC::SHAPE;
|
|
58
|
+
using OUT_SHAPE = typename D_OUTPUT_SPEC::SHAPE;
|
|
59
|
+
constexpr TI LAST_DIM_A = get_last(A_SHAPE{});
|
|
60
|
+
constexpr TI LAST_DIM_B = get_last(B_SHAPE{});
|
|
61
|
+
constexpr TI LAST_DIM_OUT = get_last(OUT_SHAPE{});
|
|
62
|
+
static_assert(LAST_DIM_OUT == LAST_DIM_A + LAST_DIM_B);
|
|
63
|
+
constexpr TI TOTAL_A = product(A_SHAPE{});
|
|
64
|
+
constexpr TI LEADING = TOTAL_A / LAST_DIM_A;
|
|
65
|
+
for(TI i = 0; i < LEADING; i++){
|
|
66
|
+
for(TI j = 0; j < LAST_DIM_A; j++){
|
|
67
|
+
*(data(d_a) + i * LAST_DIM_A + j) = get_flat(device, d_output, i * LAST_DIM_OUT + j);
|
|
68
|
+
}
|
|
69
|
+
for(TI j = 0; j < LAST_DIM_B; j++){
|
|
70
|
+
*(data(d_b) + i * LAST_DIM_B + j) = get_flat(device, d_output, i * LAST_DIM_OUT + LAST_DIM_A + j);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
template <auto NUM_BRANCHES, auto I = 0, auto OFFSET = 0, typename DEVICE, typename INTERMEDIATES, typename OUTPUT_SPEC>
|
|
76
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _concatenate_n(DEVICE& device, const INTERMEDIATES& intermediates, Tensor<OUTPUT_SPEC>& output){
|
|
77
|
+
if constexpr(I < NUM_BRANCHES){
|
|
78
|
+
using TI = typename DEVICE::index_t;
|
|
79
|
+
using OUTPUT_SHAPE = typename OUTPUT_SPEC::SHAPE;
|
|
80
|
+
constexpr TI LAST_DIM_OUT = get_last(OUTPUT_SHAPE{});
|
|
81
|
+
constexpr TI LEADING = product(OUTPUT_SHAPE{}) / LAST_DIM_OUT;
|
|
82
|
+
const auto& src = get<I>(intermediates);
|
|
83
|
+
using SRC_SHAPE = typename utils::typing::remove_reference_t<decltype(src)>::SPEC::SHAPE;
|
|
84
|
+
constexpr TI DIM_I = get_last(SRC_SHAPE{});
|
|
85
|
+
for(TI i = 0; i < LEADING; i++){
|
|
86
|
+
for(TI j = 0; j < DIM_I; j++){
|
|
87
|
+
TI src_idx = i * DIM_I + j;
|
|
88
|
+
TI out_idx = i * LAST_DIM_OUT + (TI)OFFSET + j;
|
|
89
|
+
*(data(output) + out_idx) = get_flat(device, src, src_idx);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
_concatenate_n<NUM_BRANCHES, I + 1, OFFSET + DIM_I>(device, intermediates, output);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// N-way split: extract each branch's gradient from the concatenated gradient
|
|
97
|
+
template <auto NUM_BRANCHES, auto I = 0, auto OFFSET = 0, typename DEVICE, typename D_OUTPUT_SPEC, typename D_OUTPUTS>
|
|
98
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _split_n(DEVICE& device, const Tensor<D_OUTPUT_SPEC>& d_output, D_OUTPUTS& d_outputs){
|
|
99
|
+
if constexpr(I < NUM_BRANCHES){
|
|
100
|
+
using TI = typename DEVICE::index_t;
|
|
101
|
+
using D_OUTPUT_SHAPE = typename D_OUTPUT_SPEC::SHAPE;
|
|
102
|
+
constexpr TI LAST_DIM_OUT = get_last(D_OUTPUT_SHAPE{});
|
|
103
|
+
auto& dst = get<I>(d_outputs);
|
|
104
|
+
using DST_SHAPE = typename utils::typing::remove_reference_t<decltype(dst)>::SPEC::SHAPE;
|
|
105
|
+
constexpr TI DIM_I = get_last(DST_SHAPE{});
|
|
106
|
+
constexpr TI TOTAL_DST = product(DST_SHAPE{});
|
|
107
|
+
constexpr TI LEADING = TOTAL_DST / DIM_I;
|
|
108
|
+
for(TI i = 0; i < LEADING; i++){
|
|
109
|
+
for(TI j = 0; j < DIM_I; j++){
|
|
110
|
+
TI out_idx = i * LAST_DIM_OUT + (TI)OFFSET + j;
|
|
111
|
+
TI dst_idx = i * DIM_I + j;
|
|
112
|
+
*(data(dst) + dst_idx) = get_flat(device, d_output, out_idx);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
_split_n<NUM_BRANCHES, I + 1, OFFSET + DIM_I>(device, d_output, d_outputs);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Branch iteration helpers
|
|
120
|
+
template <auto I = 0, typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename BUFFER_SPEC, typename RNG, typename MODE>
|
|
121
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _evaluate_branches(DEVICE& device, const ModuleForward<SPEC>& model, const INPUT_TUPLE& inputs, ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode){
|
|
122
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
123
|
+
evaluate(device, get<I>(model.pipelines), get<I>(inputs), get<I>(buffer.intermediates), get<I>(buffer.sub_buffers), rng, mode);
|
|
124
|
+
_evaluate_branches<I + 1>(device, model, inputs, buffer, rng, mode);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
template <auto I = 0, auto OFFSET = 0, typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename STATE_SPEC, typename CONCAT_SPEC, typename BUFFER_SPEC, typename RNG, typename MODE>
|
|
129
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _evaluate_step_branches(DEVICE& device, const ModuleForward<SPEC>& model, const INPUT_TUPLE& inputs, ModuleState<STATE_SPEC>& state, Tensor<CONCAT_SPEC>& concatenated, ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode){
|
|
130
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
131
|
+
using TI = typename DEVICE::index_t;
|
|
132
|
+
using INTERMEDIATE_SHAPE = typename utils::typing::remove_reference_t<decltype(get<I>(buffer.intermediates))>::SPEC::SHAPE;
|
|
133
|
+
constexpr TI DIM_I = get_last(INTERMEDIATE_SHAPE{});
|
|
134
|
+
auto output_view = view_range(device, concatenated, (TI)OFFSET, tensor::ViewSpec<1, DIM_I>{});
|
|
135
|
+
evaluate_step(device, get<I>(model.pipelines), get<I>(inputs), get<I>(state.states), output_view, get<I>(buffer.sub_buffers), rng, mode);
|
|
136
|
+
_evaluate_step_branches<I + 1, OFFSET + DIM_I>(device, model, inputs, state, concatenated, buffer, rng, mode);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
template <auto I = 0, typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename BUFFER_SPEC, typename RNG, typename MODE>
|
|
141
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _forward_branches(DEVICE& device, ModuleGradient<SPEC>& model, INPUT_TUPLE& inputs, ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode){
|
|
142
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
143
|
+
forward(device, get<I>(model.pipelines), get<I>(inputs), get<I>(buffer.sub_buffers), rng, mode);
|
|
144
|
+
auto output_i = rl_tools::output(device, get<I>(model.pipelines));
|
|
145
|
+
copy(device, device, output_i, get<I>(buffer.intermediates));
|
|
146
|
+
_forward_branches<I + 1>(device, model, inputs, buffer, rng, mode);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
template <auto I = 0, typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename D_INPUT_TUPLE, typename BUFFER_SPEC, typename MODE>
|
|
151
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _backward_full_branches(DEVICE& device, ModuleGradient<SPEC>& model, const INPUT_TUPLE& inputs, D_INPUT_TUPLE& d_inputs, ModuleBuffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode){
|
|
152
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
153
|
+
backward_full(device, get<I>(model.pipelines), get<I>(inputs), get<I>(buffer.d_outputs), get<I>(d_inputs), get<I>(buffer.sub_buffers), mode);
|
|
154
|
+
_backward_full_branches<I + 1>(device, model, inputs, d_inputs, buffer, mode);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
template <auto I = 0, typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename BUFFER_SPEC, typename MODE>
|
|
159
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _backward_branches(DEVICE& device, ModuleGradient<SPEC>& model, const INPUT_TUPLE& inputs, ModuleBuffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode){
|
|
160
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
161
|
+
backward(device, get<I>(model.pipelines), get<I>(inputs), get<I>(buffer.d_outputs), get<I>(buffer.sub_buffers), mode);
|
|
162
|
+
_backward_branches<I + 1>(device, model, inputs, buffer, mode);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
template <auto I = 0, typename DEVICE, typename SPEC, typename D_INPUT_TUPLE, typename BUFFER_SPEC, typename MODE>
|
|
167
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _backward_input_branches(DEVICE& device, ModuleBackward<SPEC>& model, D_INPUT_TUPLE& d_inputs, ModuleBuffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode){
|
|
168
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
169
|
+
backward_input(device, get<I>(model.pipelines), get<I>(buffer.d_outputs), get<I>(d_inputs), get<I>(buffer.sub_buffers), mode);
|
|
170
|
+
_backward_input_branches<I + 1>(device, model, d_inputs, buffer, mode);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
template <auto I = 0, typename DEVICE, typename SPEC>
|
|
175
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _malloc_pipelines(DEVICE& device, ModuleForward<SPEC>& model){
|
|
176
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
177
|
+
malloc(device, get<I>(model.pipelines));
|
|
178
|
+
_malloc_pipelines<I + 1>(device, model);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
template <auto I = 0, typename DEVICE, typename SPEC>
|
|
182
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _free_pipelines(DEVICE& device, ModuleForward<SPEC>& model){
|
|
183
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
184
|
+
free(device, get<I>(model.pipelines));
|
|
185
|
+
_free_pipelines<I + 1>(device, model);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
template <auto I = 0, typename DEVICE, typename BUFFER_SPEC>
|
|
189
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _malloc_buffer_tuples(DEVICE& device, ModuleBuffer<BUFFER_SPEC>& buffer){
|
|
190
|
+
if constexpr(I < BUFFER_SPEC::SPEC::NUM_BRANCHES){
|
|
191
|
+
malloc(device, get<I>(buffer.sub_buffers));
|
|
192
|
+
malloc(device, get<I>(buffer.intermediates));
|
|
193
|
+
malloc(device, get<I>(buffer.d_outputs));
|
|
194
|
+
_malloc_buffer_tuples<I + 1>(device, buffer);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
template <auto I = 0, typename DEVICE, typename BUFFER_SPEC>
|
|
198
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _free_buffer_tuples(DEVICE& device, ModuleBuffer<BUFFER_SPEC>& buffer){
|
|
199
|
+
if constexpr(I < BUFFER_SPEC::SPEC::NUM_BRANCHES){
|
|
200
|
+
free(device, get<I>(buffer.sub_buffers));
|
|
201
|
+
free(device, get<I>(buffer.intermediates));
|
|
202
|
+
free(device, get<I>(buffer.d_outputs));
|
|
203
|
+
_free_buffer_tuples<I + 1>(device, buffer);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
template <auto I = 0, typename DEVICE, typename STATE_SPEC>
|
|
207
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _malloc_states(DEVICE& device, ModuleState<STATE_SPEC>& state){
|
|
208
|
+
if constexpr(I < STATE_SPEC::SPEC::NUM_BRANCHES){
|
|
209
|
+
malloc(device, get<I>(state.states));
|
|
210
|
+
_malloc_states<I + 1>(device, state);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
template <auto I = 0, typename DEVICE, typename STATE_SPEC>
|
|
214
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _free_states(DEVICE& device, ModuleState<STATE_SPEC>& state){
|
|
215
|
+
if constexpr(I < STATE_SPEC::SPEC::NUM_BRANCHES){
|
|
216
|
+
free(device, get<I>(state.states));
|
|
217
|
+
_free_states<I + 1>(device, state);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
template <auto I = 0, typename DEVICE, typename SPEC, typename RNG>
|
|
222
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _init_weights_branches(DEVICE& device, ModuleForward<SPEC>& model, RNG& rng){
|
|
223
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
224
|
+
init_weights(device, get<I>(model.pipelines), rng);
|
|
225
|
+
_init_weights_branches<I + 1>(device, model, rng);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
template <auto I = 0, typename DEVICE, typename SPEC, typename STATE_SPEC, typename RNG, typename MODE>
|
|
230
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _reset_branches(DEVICE& device, const ModuleForward<SPEC>& model, ModuleState<STATE_SPEC>& state, RNG& rng, const Mode<MODE>& mode){
|
|
231
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
232
|
+
reset(device, get<I>(model.pipelines), get<I>(state.states), rng, mode);
|
|
233
|
+
_reset_branches<I + 1>(device, model, state, rng, mode);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
template <auto I = 0, typename DEVICE, typename SPEC>
|
|
238
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _zero_gradient_branches(DEVICE& device, ModuleGradient<SPEC>& model){
|
|
239
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
240
|
+
zero_gradient(device, get<I>(model.pipelines));
|
|
241
|
+
_zero_gradient_branches<I + 1>(device, model);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
template <auto I = 0, typename DEVICE, typename SPEC, typename OPTIMIZER>
|
|
246
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _update_branches(DEVICE& device, ModuleGradient<SPEC>& model, OPTIMIZER& optimizer){
|
|
247
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
248
|
+
update(device, get<I>(model.pipelines), optimizer);
|
|
249
|
+
_update_branches<I + 1>(device, model, optimizer);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
template <auto I = 0, typename DEVICE, typename SPEC, typename OPTIMIZER>
|
|
254
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _reset_optimizer_state_branches(DEVICE& device, ModuleGradient<SPEC>& model, OPTIMIZER& optimizer){
|
|
255
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
256
|
+
_reset_optimizer_state(device, get<I>(model.pipelines), optimizer);
|
|
257
|
+
_reset_optimizer_state_branches<I + 1>(device, model, optimizer);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
template <auto I = 0, typename DEVICE, typename SPEC>
|
|
262
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _reset_forward_state_branches(DEVICE& device, ModuleForward<SPEC>& model){
|
|
263
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
264
|
+
reset_forward_state(device, get<I>(model.pipelines));
|
|
265
|
+
_reset_forward_state_branches<I + 1>(device, model);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
template <auto I = 0, typename SOURCE_DEVICE, typename TARGET_DEVICE, typename SOURCE_SPEC, typename TARGET_SPEC>
|
|
270
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _copy_branches(SOURCE_DEVICE& source_device, TARGET_DEVICE& target_device, const ModuleForward<SOURCE_SPEC>& source, ModuleForward<TARGET_SPEC>& target){
|
|
271
|
+
if constexpr(I < SOURCE_SPEC::NUM_BRANCHES){
|
|
272
|
+
copy(source_device, target_device, get<I>(source.pipelines), get<I>(target.pipelines));
|
|
273
|
+
_copy_branches<I + 1>(source_device, target_device, source, target);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
template <auto I = 0, typename DEVICE, typename SPEC_A, typename SPEC_B>
|
|
278
|
+
RL_TOOLS_FUNCTION_PLACEMENT typename SPEC_A::TYPE_POLICY::DEFAULT _abs_diff_branches(DEVICE& device, ModuleForward<SPEC_A>& a, const ModuleForward<SPEC_B>& b){
|
|
279
|
+
using T = typename SPEC_A::TYPE_POLICY::DEFAULT;
|
|
280
|
+
if constexpr(I < SPEC_A::NUM_BRANCHES){
|
|
281
|
+
return static_cast<T>(abs_diff(device, get<I>(a.pipelines), get<I>(b.pipelines))) + _abs_diff_branches<I + 1>(device, a, b);
|
|
282
|
+
}
|
|
283
|
+
else{
|
|
284
|
+
return static_cast<T>(0);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
template <auto I = 0, typename DEVICE, typename SPEC, typename MODE>
|
|
289
|
+
RL_TOOLS_FUNCTION_PLACEMENT bool _is_nan_branches(DEVICE& device, ModuleForward<SPEC>& model, const Mode<MODE>& mode){
|
|
290
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
291
|
+
return is_nan(device, get<I>(model.pipelines), mode) || _is_nan_branches<I + 1>(device, model, mode);
|
|
292
|
+
}
|
|
293
|
+
else{
|
|
294
|
+
return false;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// ======================== malloc / free ========================
|
|
300
|
+
template <typename DEVICE, typename SPEC>
|
|
301
|
+
RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn_models::parallel::ModuleForward<SPEC>& module){
|
|
302
|
+
nn_models::parallel::_malloc_pipelines(device, module);
|
|
303
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
304
|
+
malloc(device, module.head);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
template <typename DEVICE, typename SPEC>
|
|
308
|
+
RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn_models::parallel::ModuleForward<SPEC>& module){
|
|
309
|
+
nn_models::parallel::_free_pipelines(device, module);
|
|
310
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
311
|
+
free(device, module.head);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
template <typename DEVICE, typename SPEC>
|
|
315
|
+
RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn_models::parallel::ModuleBackward<SPEC>& module){
|
|
316
|
+
malloc(device, static_cast<nn_models::parallel::ModuleForward<SPEC>&>(module));
|
|
317
|
+
}
|
|
318
|
+
template <typename DEVICE, typename SPEC>
|
|
319
|
+
RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn_models::parallel::ModuleBackward<SPEC>& module){
|
|
320
|
+
free(device, static_cast<nn_models::parallel::ModuleForward<SPEC>&>(module));
|
|
321
|
+
}
|
|
322
|
+
template <typename DEVICE, typename SPEC>
|
|
323
|
+
RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& module){
|
|
324
|
+
malloc(device, static_cast<nn_models::parallel::ModuleBackward<SPEC>&>(module));
|
|
325
|
+
malloc(device, module.output);
|
|
326
|
+
}
|
|
327
|
+
template <typename DEVICE, typename SPEC>
|
|
328
|
+
RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& module){
|
|
329
|
+
free(device, static_cast<nn_models::parallel::ModuleBackward<SPEC>&>(module));
|
|
330
|
+
free(device, module.output);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
template <typename DEVICE, typename BUFFER_SPEC>
|
|
334
|
+
RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer){
|
|
335
|
+
using SPEC = typename BUFFER_SPEC::SPEC;
|
|
336
|
+
nn_models::parallel::_malloc_buffer_tuples(device, buffer);
|
|
337
|
+
malloc(device, buffer.concatenated);
|
|
338
|
+
malloc(device, buffer.d_concatenated);
|
|
339
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
340
|
+
malloc(device, buffer.head_buffer);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
template <typename DEVICE, typename BUFFER_SPEC>
|
|
344
|
+
RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer){
|
|
345
|
+
using SPEC = typename BUFFER_SPEC::SPEC;
|
|
346
|
+
nn_models::parallel::_free_buffer_tuples(device, buffer);
|
|
347
|
+
free(device, buffer.concatenated);
|
|
348
|
+
free(device, buffer.d_concatenated);
|
|
349
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
350
|
+
free(device, buffer.head_buffer);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
template <typename DEVICE, typename STATE_SPEC>
|
|
355
|
+
RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn_models::parallel::ModuleState<STATE_SPEC>& state){
|
|
356
|
+
using SPEC = typename STATE_SPEC::SPEC;
|
|
357
|
+
nn_models::parallel::_malloc_states(device, state);
|
|
358
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
359
|
+
malloc(device, state.head_state);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
template <typename DEVICE, typename STATE_SPEC>
|
|
363
|
+
RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn_models::parallel::ModuleState<STATE_SPEC>& state){
|
|
364
|
+
using SPEC = typename STATE_SPEC::SPEC;
|
|
365
|
+
nn_models::parallel::_free_states(device, state);
|
|
366
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
367
|
+
free(device, state.head_state);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// ======================== init_weights ========================
|
|
372
|
+
template <typename DEVICE, typename SPEC, typename RNG>
|
|
373
|
+
RL_TOOLS_FUNCTION_PLACEMENT void init_weights(DEVICE& device, nn_models::parallel::ModuleForward<SPEC>& module, RNG& rng){
|
|
374
|
+
nn_models::parallel::_init_weights_branches(device, module, rng);
|
|
375
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
376
|
+
init_weights(device, module.head, rng);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// ======================== reset ========================
|
|
381
|
+
template <typename DEVICE, typename SPEC, typename STATE_SPEC, typename RNG, typename MODE = mode::Default<>>
|
|
382
|
+
RL_TOOLS_FUNCTION_PLACEMENT void reset(DEVICE& device, const nn_models::parallel::ModuleForward<SPEC>& model, nn_models::parallel::ModuleState<STATE_SPEC>& state, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
383
|
+
nn_models::parallel::_reset_branches(device, model, state, rng, mode);
|
|
384
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
385
|
+
reset(device, model.head, state.head_state, rng, mode);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// ======================== evaluate_step ========================
|
|
390
|
+
template <typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename STATE_SPEC, typename OUTPUT, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>, typename utils::typing::enable_if_t<nn_models::parallel::detail::is_input_tuple<utils::typing::remove_reference_t<INPUT_TUPLE>>::value>* = nullptr>
|
|
391
|
+
RL_TOOLS_FUNCTION_PLACEMENT void evaluate_step(DEVICE& device, const nn_models::parallel::ModuleForward<SPEC>& model, const INPUT_TUPLE& inputs, nn_models::parallel::ModuleState<STATE_SPEC>& state, OUTPUT& output, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
392
|
+
using TI = typename SPEC::TI;
|
|
393
|
+
using OUTPUT_SHAPE = typename OUTPUT::SPEC::SHAPE;
|
|
394
|
+
using CONCAT_BUFFER_SHAPE = typename utils::typing::remove_reference_t<decltype(buffer.concatenated)>::SPEC::SHAPE;
|
|
395
|
+
constexpr TI CONCAT_LAST_DIM = get_last(CONCAT_BUFFER_SHAPE{});
|
|
396
|
+
using CONCAT_VIEW_SHAPE = tensor::Replace<OUTPUT_SHAPE, CONCAT_LAST_DIM, length(OUTPUT_SHAPE{}) - 1>;
|
|
397
|
+
auto concat_view = view_memory<CONCAT_VIEW_SHAPE>(device, buffer.concatenated);
|
|
398
|
+
nn_models::parallel::_evaluate_step_branches(device, model, inputs, state, concat_view, buffer, rng, mode);
|
|
399
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
400
|
+
evaluate_step(device, model.head, concat_view, state.head_state, output, buffer.head_buffer, rng, mode);
|
|
401
|
+
}
|
|
402
|
+
else{
|
|
403
|
+
copy(device, device, concat_view, output);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// ======================== evaluate ========================
|
|
408
|
+
template <typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename OUTPUT, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>, typename utils::typing::enable_if_t<nn_models::parallel::detail::is_input_tuple<utils::typing::remove_reference_t<INPUT_TUPLE>>::value>* = nullptr>
|
|
409
|
+
RL_TOOLS_FUNCTION_PLACEMENT void evaluate(DEVICE& device, const nn_models::parallel::ModuleForward<SPEC>& model, const INPUT_TUPLE& inputs, OUTPUT& output, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
410
|
+
nn_models::parallel::_evaluate_branches(device, model, inputs, buffer, rng, mode);
|
|
411
|
+
nn_models::parallel::_concatenate_n<SPEC::NUM_BRANCHES>(device, buffer.intermediates, buffer.concatenated);
|
|
412
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
413
|
+
evaluate(device, model.head, buffer.concatenated, output, buffer.head_buffer, rng, mode);
|
|
414
|
+
}
|
|
415
|
+
else{
|
|
416
|
+
copy(device, device, buffer.concatenated, output);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// ======================== forward ========================
|
|
421
|
+
template <typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>, typename utils::typing::enable_if_t<nn_models::parallel::detail::is_input_tuple<utils::typing::remove_reference_t<INPUT_TUPLE>>::value>* = nullptr>
|
|
422
|
+
RL_TOOLS_FUNCTION_PLACEMENT void forward(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& model, INPUT_TUPLE& inputs, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
423
|
+
nn_models::parallel::_forward_branches(device, model, inputs, buffer, rng, mode);
|
|
424
|
+
nn_models::parallel::_concatenate_n<SPEC::NUM_BRANCHES>(device, buffer.intermediates, buffer.concatenated);
|
|
425
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
426
|
+
forward(device, model.head, buffer.concatenated, buffer.head_buffer, rng, mode);
|
|
427
|
+
auto head_output = rl_tools::output(device, model.head);
|
|
428
|
+
copy(device, device, head_output, model.output);
|
|
429
|
+
}
|
|
430
|
+
else{
|
|
431
|
+
copy(device, device, buffer.concatenated, model.output);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
template <typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename OUTPUT, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>, typename utils::typing::enable_if_t<nn_models::parallel::detail::is_input_tuple<utils::typing::remove_reference_t<INPUT_TUPLE>>::value>* = nullptr>
|
|
436
|
+
RL_TOOLS_FUNCTION_PLACEMENT void forward(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& model, INPUT_TUPLE& inputs, OUTPUT& output, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
437
|
+
forward(device, model, inputs, buffer, rng, mode);
|
|
438
|
+
copy(device, device, model.output, output);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// ======================== backward_full ========================
|
|
442
|
+
template <typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename D_OUTPUT, typename D_INPUT_TUPLE, typename BUFFER_SPEC, typename MODE = mode::Default<>, typename utils::typing::enable_if_t<nn_models::parallel::detail::is_input_tuple<utils::typing::remove_reference_t<INPUT_TUPLE>>::value>* = nullptr>
|
|
443
|
+
RL_TOOLS_FUNCTION_PLACEMENT void backward_full(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& model, const INPUT_TUPLE& inputs, D_OUTPUT& d_output, D_INPUT_TUPLE& d_inputs, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
444
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
445
|
+
backward_full(device, model.head, buffer.concatenated, d_output, buffer.d_concatenated, buffer.head_buffer, mode);
|
|
446
|
+
nn_models::parallel::_split_n<SPEC::NUM_BRANCHES>(device, buffer.d_concatenated, buffer.d_outputs);
|
|
447
|
+
}
|
|
448
|
+
else{
|
|
449
|
+
nn_models::parallel::_split_n<SPEC::NUM_BRANCHES>(device, d_output, buffer.d_outputs);
|
|
450
|
+
}
|
|
451
|
+
nn_models::parallel::_backward_full_branches(device, model, inputs, d_inputs, buffer, mode);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// ======================== backward (gradients only) ========================
|
|
455
|
+
template <typename DEVICE, typename SPEC, typename INPUT_TUPLE, typename D_OUTPUT, typename BUFFER_SPEC, typename MODE = mode::Default<>, typename utils::typing::enable_if_t<nn_models::parallel::detail::is_input_tuple<utils::typing::remove_reference_t<INPUT_TUPLE>>::value>* = nullptr>
|
|
456
|
+
RL_TOOLS_FUNCTION_PLACEMENT void backward(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& model, const INPUT_TUPLE& inputs, D_OUTPUT& d_output, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
457
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
458
|
+
backward_full(device, model.head, buffer.concatenated, d_output, buffer.d_concatenated, buffer.head_buffer, mode);
|
|
459
|
+
nn_models::parallel::_split_n<SPEC::NUM_BRANCHES>(device, buffer.d_concatenated, buffer.d_outputs);
|
|
460
|
+
}
|
|
461
|
+
else{
|
|
462
|
+
nn_models::parallel::_split_n<SPEC::NUM_BRANCHES>(device, d_output, buffer.d_outputs);
|
|
463
|
+
}
|
|
464
|
+
nn_models::parallel::_backward_branches(device, model, inputs, buffer, mode);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// ======================== backward_input ========================
|
|
468
|
+
template <typename DEVICE, typename SPEC, typename D_OUTPUT, typename D_INPUT_TUPLE, typename BUFFER_SPEC, typename MODE = mode::Default<>>
|
|
469
|
+
RL_TOOLS_FUNCTION_PLACEMENT void backward_input(DEVICE& device, nn_models::parallel::ModuleBackward<SPEC>& model, D_OUTPUT& d_output, D_INPUT_TUPLE& d_inputs, nn_models::parallel::ModuleBuffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
470
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
471
|
+
backward_input(device, model.head, d_output, buffer.d_concatenated, buffer.head_buffer, mode);
|
|
472
|
+
nn_models::parallel::_split_n<SPEC::NUM_BRANCHES>(device, buffer.d_concatenated, buffer.d_outputs);
|
|
473
|
+
}
|
|
474
|
+
else{
|
|
475
|
+
nn_models::parallel::_split_n<SPEC::NUM_BRANCHES>(device, d_output, buffer.d_outputs);
|
|
476
|
+
}
|
|
477
|
+
nn_models::parallel::_backward_input_branches(device, model, d_inputs, buffer, mode);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// ======================== zero_gradient ========================
|
|
481
|
+
template <typename DEVICE, typename SPEC>
|
|
482
|
+
RL_TOOLS_FUNCTION_PLACEMENT void zero_gradient(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& module){
|
|
483
|
+
nn_models::parallel::_zero_gradient_branches(device, module);
|
|
484
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
485
|
+
zero_gradient(device, module.head);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// ======================== update ========================
|
|
490
|
+
template <typename DEVICE, typename SPEC, typename OPTIMIZER>
|
|
491
|
+
RL_TOOLS_FUNCTION_PLACEMENT void update(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& module, OPTIMIZER& optimizer){
|
|
492
|
+
nn_models::parallel::_update_branches(device, module, optimizer);
|
|
493
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
494
|
+
update(device, module.head, optimizer);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// ======================== _reset_optimizer_state ========================
|
|
499
|
+
template <typename DEVICE, typename SPEC, typename OPTIMIZER>
|
|
500
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _reset_optimizer_state(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& module, OPTIMIZER& optimizer){
|
|
501
|
+
nn_models::parallel::_reset_optimizer_state_branches(device, module, optimizer);
|
|
502
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
503
|
+
_reset_optimizer_state(device, module.head, optimizer);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// ======================== reset_forward_state ========================
|
|
508
|
+
template <typename DEVICE, typename SPEC>
|
|
509
|
+
RL_TOOLS_FUNCTION_PLACEMENT void reset_forward_state(DEVICE& device, nn_models::parallel::ModuleForward<SPEC>& module){
|
|
510
|
+
nn_models::parallel::_reset_forward_state_branches(device, module);
|
|
511
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
512
|
+
reset_forward_state(device, module.head);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// ======================== copy ========================
|
|
517
|
+
template <typename SOURCE_DEVICE, typename TARGET_DEVICE, typename SOURCE_SPEC, typename TARGET_SPEC>
|
|
518
|
+
RL_TOOLS_FUNCTION_PLACEMENT void copy(SOURCE_DEVICE& source_device, TARGET_DEVICE& target_device, const nn_models::parallel::ModuleForward<SOURCE_SPEC>& source, nn_models::parallel::ModuleForward<TARGET_SPEC>& target){
|
|
519
|
+
nn_models::parallel::_copy_branches(source_device, target_device, source, target);
|
|
520
|
+
if constexpr(SOURCE_SPEC::HAS_HEAD){
|
|
521
|
+
static_assert(TARGET_SPEC::HAS_HEAD, "Source has HEAD but target does not");
|
|
522
|
+
copy(source_device, target_device, source.head, target.head);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
// ======================== abs_diff ========================
|
|
527
|
+
template <typename DEVICE, typename SPEC_A, typename SPEC_B>
|
|
528
|
+
RL_TOOLS_FUNCTION_PLACEMENT typename SPEC_A::TYPE_POLICY::DEFAULT abs_diff(DEVICE& device, nn_models::parallel::ModuleForward<SPEC_A>& a, const nn_models::parallel::ModuleForward<SPEC_B>& b){
|
|
529
|
+
using T = typename SPEC_A::TYPE_POLICY::DEFAULT;
|
|
530
|
+
T result = nn_models::parallel::_abs_diff_branches(device, a, b);
|
|
531
|
+
if constexpr(SPEC_A::HAS_HEAD){
|
|
532
|
+
result += static_cast<T>(abs_diff(device, a.head, b.head));
|
|
533
|
+
}
|
|
534
|
+
return result;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// ======================== is_nan ========================
|
|
538
|
+
template <typename DEVICE, typename SPEC, typename MODE = mode::Default<>>
|
|
539
|
+
RL_TOOLS_FUNCTION_PLACEMENT bool is_nan(DEVICE& device, nn_models::parallel::ModuleForward<SPEC>& model, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
540
|
+
bool result = nn_models::parallel::_is_nan_branches(device, model, mode);
|
|
541
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
542
|
+
result = result || is_nan(device, model.head, mode);
|
|
543
|
+
}
|
|
544
|
+
return result;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// ======================== output ========================
|
|
548
|
+
template <typename DEVICE, typename SPEC>
|
|
549
|
+
RL_TOOLS_FUNCTION_PLACEMENT auto output(DEVICE& device, nn_models::parallel::ModuleGradient<SPEC>& model){
|
|
550
|
+
return view_memory<typename SPEC::OUTPUT_SHAPE>(device, model.output);
|
|
551
|
+
}
|
|
552
|
+
template <typename DEVICE, typename SPEC>
|
|
553
|
+
RL_TOOLS_FUNCTION_PLACEMENT auto output(DEVICE& device, const nn_models::parallel::ModuleGradient<SPEC>& model){
|
|
554
|
+
return view_memory<typename SPEC::OUTPUT_SHAPE>(device, model.output);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// ======================== get_last_layer ========================
|
|
558
|
+
template <typename SPEC>
|
|
559
|
+
RL_TOOLS_FUNCTION_PLACEMENT auto& get_last_layer(nn_models::parallel::ModuleForward<SPEC>& model){
|
|
560
|
+
static_assert(SPEC::HAS_HEAD, "get_last_layer on parallel model requires a HEAD module");
|
|
561
|
+
return model.head;
|
|
562
|
+
}
|
|
563
|
+
template <typename SPEC>
|
|
564
|
+
RL_TOOLS_FUNCTION_PLACEMENT auto& get_last_layer(const nn_models::parallel::ModuleForward<SPEC>& model){
|
|
565
|
+
static_assert(SPEC::HAS_HEAD, "get_last_layer on parallel model requires a HEAD module");
|
|
566
|
+
return model.head;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
RL_TOOLS_NAMESPACE_WRAPPER_END
|
|
570
|
+
|
|
571
|
+
#endif
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#include "../../version.h"
|
|
2
|
+
#if (defined(RL_TOOLS_DISABLE_INCLUDE_GUARDS) || !defined(RL_TOOLS_NN_MODELS_PARALLEL_PERSIST_H)) && (RL_TOOLS_USE_THIS_VERSION == 1)
|
|
3
|
+
#pragma once
|
|
4
|
+
#define RL_TOOLS_NN_MODELS_PARALLEL_PERSIST_H
|
|
5
|
+
|
|
6
|
+
#include "model.h"
|
|
7
|
+
#include "../sequential/persist.h"
|
|
8
|
+
|
|
9
|
+
#include <sstream>
|
|
10
|
+
#include <string>
|
|
11
|
+
|
|
12
|
+
RL_TOOLS_NAMESPACE_WRAPPER_START
|
|
13
|
+
namespace rl_tools{
|
|
14
|
+
namespace nn_models::parallel{
|
|
15
|
+
template <typename SHAPE, auto INDEX = 0>
|
|
16
|
+
void _shape_to_csv(std::stringstream& ss){
|
|
17
|
+
if constexpr(INDEX == 0){
|
|
18
|
+
ss << get<0>(SHAPE{});
|
|
19
|
+
}
|
|
20
|
+
else{
|
|
21
|
+
ss << "," << get<INDEX>(SHAPE{});
|
|
22
|
+
}
|
|
23
|
+
if constexpr(INDEX + 1 < length(SHAPE{})){
|
|
24
|
+
_shape_to_csv<SHAPE, INDEX + 1>(ss);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
template <auto I = 0, typename DEVICE, typename SPEC, typename GROUP>
|
|
29
|
+
void _save_branches(DEVICE& device, ModuleForward<SPEC>& model, GROUP& group){
|
|
30
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
31
|
+
std::string name = "branch_" + std::to_string(I);
|
|
32
|
+
auto branch_group = create_group(device, group, name.c_str());
|
|
33
|
+
using BRANCH = typename utils::tuple_element<I, typename SPEC::BRANCH_TUPLE>::type;
|
|
34
|
+
using INPUT_SHAPE = typename BRANCH::INPUT_SHAPE;
|
|
35
|
+
std::stringstream shape_ss;
|
|
36
|
+
_shape_to_csv<INPUT_SHAPE>(shape_ss);
|
|
37
|
+
set_attribute(device, branch_group, "input_shape", shape_ss.str().c_str());
|
|
38
|
+
save(device, get<I>(model.pipelines), branch_group);
|
|
39
|
+
_save_branches<I + 1>(device, model, group);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
template <auto I = 0, typename DEVICE, typename SPEC, typename GROUP>
|
|
43
|
+
bool _load_branches(DEVICE& device, ModuleForward<SPEC>& model, GROUP& group){
|
|
44
|
+
if constexpr(I < SPEC::NUM_BRANCHES){
|
|
45
|
+
std::string name = "branch_" + std::to_string(I);
|
|
46
|
+
auto branch_group = get_group(device, group, name.c_str());
|
|
47
|
+
bool success = load(device, get<I>(model.pipelines), branch_group);
|
|
48
|
+
return success && _load_branches<I + 1>(device, model, group);
|
|
49
|
+
}
|
|
50
|
+
else{
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
template<typename DEVICE, typename SPEC, typename GROUP>
|
|
57
|
+
void save(DEVICE& device, nn_models::parallel::ModuleForward<SPEC>& model, GROUP& group){
|
|
58
|
+
set_attribute(device, group, "type", "parallel");
|
|
59
|
+
set_attribute(device, group, "num_branches", std::to_string(SPEC::NUM_BRANCHES).c_str());
|
|
60
|
+
set_attribute(device, group, "has_head", SPEC::HAS_HEAD ? "1" : "0");
|
|
61
|
+
write_attributes(device, group);
|
|
62
|
+
nn_models::parallel::_save_branches(device, model, group);
|
|
63
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
64
|
+
auto group_head = create_group(device, group, "head");
|
|
65
|
+
save(device, model.head, group_head);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
template<typename DEVICE, typename SPEC, typename GROUP>
|
|
70
|
+
bool load(DEVICE& device, nn_models::parallel::ModuleForward<SPEC>& model, GROUP& group){
|
|
71
|
+
bool success = nn_models::parallel::_load_branches(device, model, group);
|
|
72
|
+
if constexpr(SPEC::HAS_HEAD){
|
|
73
|
+
auto group_head = get_group(device, group, "head");
|
|
74
|
+
success &= load(device, model.head, group_head);
|
|
75
|
+
}
|
|
76
|
+
return success;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
RL_TOOLS_NAMESPACE_WRAPPER_END
|
|
80
|
+
#endif
|