tt-rl 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.
- tt_rl-0.1.0.dist-info/METADATA +273 -0
- tt_rl-0.1.0.dist-info/RECORD +229 -0
- tt_rl-0.1.0.dist-info/WHEEL +5 -0
- tt_rl-0.1.0.dist-info/entry_points.txt +2 -0
- tt_rl-0.1.0.dist-info/licenses/LICENSE +21 -0
- tt_rl-0.1.0.dist-info/top_level.txt +1 -0
- ttrl/__init__.py +269 -0
- ttrl/algos/__init__.py +52 -0
- ttrl/algos/base.py +253 -0
- ttrl/algos/checkpoint.py +112 -0
- ttrl/algos/checks.py +131 -0
- ttrl/algos/clock.py +99 -0
- ttrl/algos/config.py +118 -0
- ttrl/algos/dqn/__init__.py +31 -0
- ttrl/algos/dqn/agent.py +265 -0
- ttrl/algos/dqn/config.py +151 -0
- ttrl/algos/dqn/losses.py +140 -0
- ttrl/algos/gaussian.py +167 -0
- ttrl/algos/grads.py +65 -0
- ttrl/algos/mask.py +165 -0
- ttrl/algos/offpolicy.py +145 -0
- ttrl/algos/ppo/__init__.py +32 -0
- ttrl/algos/ppo/agent.py +238 -0
- ttrl/algos/ppo/boundaries.py +259 -0
- ttrl/algos/ppo/build.py +37 -0
- ttrl/algos/ppo/config.py +211 -0
- ttrl/algos/ppo/learn.py +112 -0
- ttrl/algos/ppo/loss.py +83 -0
- ttrl/algos/ppo/partial.py +259 -0
- ttrl/algos/ppo/policy.py +206 -0
- ttrl/algos/ppo/recurrent.py +233 -0
- ttrl/algos/ppo/state.py +65 -0
- ttrl/algos/registry.py +51 -0
- ttrl/algos/sac/__init__.py +30 -0
- ttrl/algos/sac/agent.py +296 -0
- ttrl/algos/sac/config.py +183 -0
- ttrl/algos/sac/losses.py +94 -0
- ttrl/algos/sac/policy.py +59 -0
- ttrl/algos/sac/step.py +130 -0
- ttrl/algos/sac/targets.py +96 -0
- ttrl/algos/scaling.py +101 -0
- ttrl/buffers/__init__.py +21 -0
- ttrl/buffers/boundaries.py +106 -0
- ttrl/buffers/checks.py +130 -0
- ttrl/buffers/indexing.py +131 -0
- ttrl/buffers/openepisodes.py +55 -0
- ttrl/buffers/persist.py +239 -0
- ttrl/buffers/replay.py +282 -0
- ttrl/buffers/replaybatch.py +76 -0
- ttrl/buffers/rollout.py +290 -0
- ttrl/buffers/samplers.py +168 -0
- ttrl/buffers/sampling.py +258 -0
- ttrl/buffers/seqbatch.py +120 -0
- ttrl/buffers/sequences.py +202 -0
- ttrl/buffers/types.py +161 -0
- ttrl/buffers/window.py +179 -0
- ttrl/buffers/writes.py +70 -0
- ttrl/cli/__init__.py +46 -0
- ttrl/cli/__main__.py +7 -0
- ttrl/cli/doctor.py +52 -0
- ttrl/cli/logs.py +49 -0
- ttrl/cli/probes/__init__.py +1 -0
- ttrl/cli/probes/_ttnn.py +21 -0
- ttrl/cli/probes/chip_report.py +90 -0
- ttrl/cli/probes/chips.py +91 -0
- ttrl/cli/probes/extras.py +57 -0
- ttrl/cli/probes/hardware.py +151 -0
- ttrl/cli/probes/traps.py +81 -0
- ttrl/cli/probes/versions.py +207 -0
- ttrl/cli/report.py +103 -0
- ttrl/cli/train.py +210 -0
- ttrl/deploy/__init__.py +47 -0
- ttrl/deploy/artifact.py +283 -0
- ttrl/deploy/conv.py +69 -0
- ttrl/deploy/export.py +240 -0
- ttrl/deploy/graph.py +285 -0
- ttrl/deploy/policies.py +115 -0
- ttrl/deploy/read.py +75 -0
- ttrl/deploy/towers.py +73 -0
- ttrl/deploy/transform.py +108 -0
- ttrl/engine/__init__.py +96 -0
- ttrl/engine/autograd.py +271 -0
- ttrl/engine/carry.py +165 -0
- ttrl/engine/config.py +23 -0
- ttrl/engine/conv/__init__.py +77 -0
- ttrl/engine/conv/backward.py +78 -0
- ttrl/engine/conv/config.py +144 -0
- ttrl/engine/conv/forward.py +205 -0
- ttrl/engine/conv/geometry.py +277 -0
- ttrl/engine/conv/module.py +263 -0
- ttrl/engine/conv/packing.py +187 -0
- ttrl/engine/conv/transform.py +277 -0
- ttrl/engine/conv/weights.py +238 -0
- ttrl/engine/device/__init__.py +71 -0
- ttrl/engine/device/acquire.py +140 -0
- ttrl/engine/device/liveness.py +299 -0
- ttrl/engine/device/profile.py +77 -0
- ttrl/engine/device/scope.py +229 -0
- ttrl/engine/layers.py +200 -0
- ttrl/engine/mesh/__init__.py +44 -0
- ttrl/engine/mesh/devices.py +116 -0
- ttrl/engine/mesh/open.py +187 -0
- ttrl/engine/mesh/resume.py +100 -0
- ttrl/engine/mesh/sync.py +249 -0
- ttrl/engine/mesh/topology.py +128 -0
- ttrl/engine/nn/__init__.py +6 -0
- ttrl/engine/nn/containers.py +84 -0
- ttrl/engine/nn/discovery.py +163 -0
- ttrl/engine/nn/module.py +190 -0
- ttrl/engine/ops/__init__.py +44 -0
- ttrl/engine/ops/broadcast.py +55 -0
- ttrl/engine/ops/elementwise.py +148 -0
- ttrl/engine/ops/functional.py +195 -0
- ttrl/engine/ops/matmul.py +86 -0
- ttrl/engine/ops/reduce.py +99 -0
- ttrl/engine/ops/select.py +63 -0
- ttrl/engine/ops/shape.py +151 -0
- ttrl/engine/ops/unary.py +150 -0
- ttrl/engine/optim/__init__.py +7 -0
- ttrl/engine/optim/adam.py +137 -0
- ttrl/engine/optim/base.py +15 -0
- ttrl/engine/optim/checkpoint.py +104 -0
- ttrl/engine/optim/scalars.py +27 -0
- ttrl/engine/recurrent.py +168 -0
- ttrl/engine/step/__init__.py +7 -0
- ttrl/engine/step/core.py +160 -0
- ttrl/engine/step/inputs.py +102 -0
- ttrl/engine/step/metrics.py +112 -0
- ttrl/engine/tensor/__init__.py +26 -0
- ttrl/engine/tensor/arena.py +87 -0
- ttrl/engine/tensor/precision.py +28 -0
- ttrl/engine/tensor/transfer.py +51 -0
- ttrl/engine/trace.py +126 -0
- ttrl/envs/__init__.py +87 -0
- ttrl/envs/_children.py +145 -0
- ttrl/envs/_worker.py +85 -0
- ttrl/envs/atari/__init__.py +141 -0
- ttrl/envs/atari/emulator.py +77 -0
- ttrl/envs/atari/wrappers.py +220 -0
- ttrl/envs/base.py +190 -0
- ttrl/envs/bounds.py +98 -0
- ttrl/envs/check.py +173 -0
- ttrl/envs/check_clauses.py +201 -0
- ttrl/envs/episodes.py +125 -0
- ttrl/envs/gym_adapter.py +154 -0
- ttrl/envs/mujoco.py +229 -0
- ttrl/envs/obs_batch.py +76 -0
- ttrl/envs/registry.py +96 -0
- ttrl/envs/render.py +77 -0
- ttrl/envs/running.py +108 -0
- ttrl/envs/vec_normalize.py +292 -0
- ttrl/envs/vec_wrapper.py +152 -0
- ttrl/envs/vector.py +223 -0
- ttrl/envs/vector_async.py +212 -0
- ttrl/envs/wrappers/__init__.py +45 -0
- ttrl/envs/wrappers/control.py +137 -0
- ttrl/envs/wrappers/core.py +299 -0
- ttrl/envs/wrappers/leaf.py +85 -0
- ttrl/envs/wrappers/observation.py +133 -0
- ttrl/envs/wrappers/privileged.py +73 -0
- ttrl/envs/wrappers/reward.py +57 -0
- ttrl/nets/__init__.py +100 -0
- ttrl/nets/acting.py +188 -0
- ttrl/nets/build.py +215 -0
- ttrl/nets/choice.py +130 -0
- ttrl/nets/encoders.py +237 -0
- ttrl/nets/fusion.py +71 -0
- ttrl/nets/heads.py +116 -0
- ttrl/nets/models.py +135 -0
- ttrl/nets/multi.py +145 -0
- ttrl/nets/obs.py +213 -0
- ttrl/nets/recurrent.py +196 -0
- ttrl/nets/registry.py +241 -0
- ttrl/nets/towers.py +60 -0
- ttrl/spaces/__init__.py +29 -0
- ttrl/spaces/action.py +169 -0
- ttrl/spaces/fields.py +96 -0
- ttrl/spaces/group.py +239 -0
- ttrl/spaces/mask.py +89 -0
- ttrl/spaces/obs.py +266 -0
- ttrl/spaces/observation.py +241 -0
- ttrl/spaces/refusals.py +88 -0
- ttrl/train/__init__.py +64 -0
- ttrl/train/builders.py +146 -0
- ttrl/train/cadence.py +258 -0
- ttrl/train/checkpoint/__init__.py +52 -0
- ttrl/train/checkpoint/atomic.py +37 -0
- ttrl/train/checkpoint/best.py +279 -0
- ttrl/train/checkpoint/file.py +218 -0
- ttrl/train/checkpoint/history.py +103 -0
- ttrl/train/checkpoint/read.py +104 -0
- ttrl/train/checkpoint/retype.py +47 -0
- ttrl/train/checkpoint/specs.py +62 -0
- ttrl/train/checkpoint/tree.py +261 -0
- ttrl/train/checkpoint/types.py +67 -0
- ttrl/train/config/__init__.py +24 -0
- ttrl/train/config/coerce.py +222 -0
- ttrl/train/config/device.py +127 -0
- ttrl/train/config/env.py +152 -0
- ttrl/train/config/horizon.py +75 -0
- ttrl/train/config/loader.py +160 -0
- ttrl/train/config/overrides.py +129 -0
- ttrl/train/config/schema.py +279 -0
- ttrl/train/device.py +68 -0
- ttrl/train/eval_checkpoint.py +120 -0
- ttrl/train/eval_metrics.py +64 -0
- ttrl/train/evaluate.py +208 -0
- ttrl/train/film.py +182 -0
- ttrl/train/gitstate.py +141 -0
- ttrl/train/hooks.py +62 -0
- ttrl/train/logging.py +294 -0
- ttrl/train/loop.py +266 -0
- ttrl/train/periodic.py +74 -0
- ttrl/train/provenance.py +218 -0
- ttrl/train/record.py +251 -0
- ttrl/train/record_env.py +67 -0
- ttrl/train/replicas.py +289 -0
- ttrl/train/restore.py +117 -0
- ttrl/train/resume.py +210 -0
- ttrl/train/resume_env.py +161 -0
- ttrl/train/run.py +96 -0
- ttrl/train/scoping.py +110 -0
- ttrl/train/snapshot.py +137 -0
- ttrl/train/stop.py +144 -0
- ttrl/train/teardown.py +148 -0
- ttrl/train/throughput.py +64 -0
- ttrl/train/trackers.py +125 -0
- ttrl/train/trainer.py +299 -0
- ttrl/train/video.py +46 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tt-rl
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Reinforcement learning on Tenstorrent, natively on TT-NN
|
|
5
|
+
Author: Antoni Bertel
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/scaleresearch/tt-rl
|
|
8
|
+
Project-URL: Repository, https://github.com/scaleresearch/tt-rl
|
|
9
|
+
Project-URL: Issues, https://github.com/scaleresearch/tt-rl/issues
|
|
10
|
+
Keywords: reinforcement-learning,tenstorrent,ttnn,blackhole,rl
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
17
|
+
Requires-Python: <3.13,>=3.12
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: ttnn<0.81,>=0.80.0
|
|
21
|
+
Requires-Dist: numpy<2,>=1.26
|
|
22
|
+
Provides-Extra: atari
|
|
23
|
+
Requires-Dist: gymnasium[atari]>=1.4; extra == "atari"
|
|
24
|
+
Requires-Dist: ale-py>=0.12; extra == "atari"
|
|
25
|
+
Requires-Dist: opencv-python-headless>=4.11; extra == "atari"
|
|
26
|
+
Provides-Extra: mujoco
|
|
27
|
+
Requires-Dist: gymnasium[mujoco]>=1.4; extra == "mujoco"
|
|
28
|
+
Requires-Dist: mujoco<4,>=3.17; extra == "mujoco"
|
|
29
|
+
Requires-Dist: opencv-python-headless>=4.11; extra == "mujoco"
|
|
30
|
+
Provides-Extra: logging
|
|
31
|
+
Requires-Dist: tensorboard>=2.21; extra == "logging"
|
|
32
|
+
Provides-Extra: tracker
|
|
33
|
+
Requires-Dist: wandb>=0.19; extra == "tracker"
|
|
34
|
+
Provides-Extra: plots
|
|
35
|
+
Requires-Dist: matplotlib>=3.9; extra == "plots"
|
|
36
|
+
Provides-Extra: onnx
|
|
37
|
+
Requires-Dist: onnx>=1.21; extra == "onnx"
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: pytest>=9; extra == "dev"
|
|
40
|
+
Requires-Dist: torch>=2.14; extra == "dev"
|
|
41
|
+
Requires-Dist: tensorboard>=2.21; extra == "dev"
|
|
42
|
+
Requires-Dist: matplotlib>=3.9; extra == "dev"
|
|
43
|
+
Requires-Dist: tt-rl[onnx]; extra == "dev"
|
|
44
|
+
Requires-Dist: onnxruntime>=1.20; extra == "dev"
|
|
45
|
+
Requires-Dist: tt-rl[atari]; extra == "dev"
|
|
46
|
+
Requires-Dist: tt-rl[mujoco]; extra == "dev"
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
|
|
49
|
+
# tt-rl
|
|
50
|
+
|
|
51
|
+
[](https://github.com/scaleresearch/tt-rl/actions/workflows/ci.yml)
|
|
52
|
+
[](LICENSE)
|
|
53
|
+
|
|
54
|
+
Reinforcement learning on Tenstorrent hardware, built directly on
|
|
55
|
+
[TT-NN](https://github.com/tenstorrent/tt-metal). Networks, gradients, the Adam
|
|
56
|
+
step and the device trace all run on the chip through `ttnn`. Environments
|
|
57
|
+
and replay buffers stay on the host.
|
|
58
|
+
|
|
59
|
+
<table>
|
|
60
|
+
<tr>
|
|
61
|
+
<td align="center"><img src="https://raw.githubusercontent.com/scaleresearch/tt-rl/master/assets/pong.gif" height="260" alt="Pong"><br>Pong, DQN</td>
|
|
62
|
+
<td align="center"><img src="https://raw.githubusercontent.com/scaleresearch/tt-rl/master/assets/breakout.gif" height="260" alt="Breakout"><br>Breakout, DQN</td>
|
|
63
|
+
<td align="center"><img src="https://raw.githubusercontent.com/scaleresearch/tt-rl/master/assets/boxing.gif" height="260" alt="Boxing"><br>Boxing, DQN</td>
|
|
64
|
+
<td align="center"><img src="https://raw.githubusercontent.com/scaleresearch/tt-rl/master/assets/hopper.gif" height="260" alt="Hopper"><br>Hopper, SAC</td>
|
|
65
|
+
</tr>
|
|
66
|
+
</table>
|
|
67
|
+
|
|
68
|
+
- **Algorithms:** DQN (double, n-step, prioritized replay), PPO (GAE, clipping,
|
|
69
|
+
optional GRU memory) and SAC (twin critics, learned temperature).
|
|
70
|
+
- **Environments:** Atari pixels, MuJoCo state vectors, and any environment you
|
|
71
|
+
write against a small protocol.
|
|
72
|
+
- **Single or multiple chips:** a run trains on one chip, or data-parallel
|
|
73
|
+
across several with one replica per chip.
|
|
74
|
+
- **Deploy anywhere:** export a trained policy to numpy or ONNX and run it on
|
|
75
|
+
any CPU.
|
|
76
|
+
|
|
77
|
+
## Results
|
|
78
|
+
|
|
79
|
+
Measured on one Blackhole chip. Atari scores are the mean over 30 evaluation
|
|
80
|
+
episodes with sticky actions (0.25), which is harder than the
|
|
81
|
+
`NoFrameskip-v4` setting most published numbers use. A step is one agent
|
|
82
|
+
action, four Atari frames. Each score is the best evaluation of its run.
|
|
83
|
+
|
|
84
|
+
| Task | Algorithm | Steps | Score | Weights |
|
|
85
|
+
|---|---|---|---|---|
|
|
86
|
+
| Pong | DQN | 10M | 17.8 | [ttrl-dqn-pong](https://huggingface.co/scaleresearch/ttrl-dqn-pong) |
|
|
87
|
+
| Breakout | DQN | 10M | 144.8 | [ttrl-dqn-breakout](https://huggingface.co/scaleresearch/ttrl-dqn-breakout) |
|
|
88
|
+
| Boxing | DQN | 10M | 91.0 | [ttrl-dqn-boxing](https://huggingface.co/scaleresearch/ttrl-dqn-boxing) |
|
|
89
|
+
| Hopper-v5 | SAC | 1M | 3604 | [ttrl-sac-hopper](https://huggingface.co/scaleresearch/ttrl-sac-hopper) |
|
|
90
|
+
|
|
91
|
+
Each config in `configs/` records how it was measured in its docstring. The
|
|
92
|
+
trained policies are on Hugging Face as ONNX and numpy weights, with a
|
|
93
|
+
`play.py` that runs them on CPU.
|
|
94
|
+
|
|
95
|
+
### Learning
|
|
96
|
+
|
|
97
|
+
From an untrained agent to the final one, at fixed checkpoints of the same
|
|
98
|
+
run (Atari clips play at 3x speed):
|
|
99
|
+
|
|
100
|
+

|
|
101
|
+
|
|
102
|
+

|
|
103
|
+
|
|
104
|
+
<details>
|
|
105
|
+
<summary>Breakout and Boxing</summary>
|
|
106
|
+
|
|
107
|
+

|
|
108
|
+
|
|
109
|
+

|
|
110
|
+
|
|
111
|
+
</details>
|
|
112
|
+
|
|
113
|
+
## Requirements
|
|
114
|
+
|
|
115
|
+
- Linux and Python 3.12. `ttnn` 0.80 ships wheels for 3.10 and 3.12, and
|
|
116
|
+
3.10 is dropped because current Pillow and filelock no longer support it.
|
|
117
|
+
- A Tenstorrent Blackhole chip with its driver and firmware installed.
|
|
118
|
+
Developed on a TT-QuietBox with four Blackhole chips.
|
|
119
|
+
|
|
120
|
+
## Install
|
|
121
|
+
|
|
122
|
+
ttrl installs from source for now. A PyPI release as `tt-rl` is on its way,
|
|
123
|
+
after which `pip install tt-rl` will be enough.
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
git clone https://github.com/scaleresearch/tt-rl && cd tt-rl
|
|
127
|
+
pip install -e '.[atari]' # Atari
|
|
128
|
+
pip install -e '.[mujoco]' # MuJoCo
|
|
129
|
+
pip install -e '.[dev]' # both, plus the test suite's dependencies
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`ttnn` installs from PyPI as a dependency. Then check the machine:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
ttrl doctor
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
It reports versions, which chips exist and who holds each one, and opens a
|
|
139
|
+
free chip to confirm a trace captures and replays.
|
|
140
|
+
|
|
141
|
+
## Train
|
|
142
|
+
|
|
143
|
+
A run is a Python config. Arguments after the path override any field by
|
|
144
|
+
its dotted name:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
ttrl train configs/pong_dqn.py device.chip=0
|
|
148
|
+
ttrl train configs/pong_dqn.py total_frames=3000 algo_cfg.learning_starts=500 log_dir=runs/smoke
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
The same from Python:
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
import ttrl
|
|
155
|
+
|
|
156
|
+
config = ttrl.load_config("configs/pong_dqn.py", overrides=["device.chip=0"])
|
|
157
|
+
result = ttrl.run(config)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
A run writes metrics, checkpoints and `checkpoint-best.npz` to its
|
|
161
|
+
`log_dir`. `ttrl train --resume best <config>` continues from the best one;
|
|
162
|
+
DQN and SAC runs also need `checkpoint_replay=True` so the replay buffer is
|
|
163
|
+
saved with them.
|
|
164
|
+
`examples/atari-dqn` and `examples/mujoco-sac` are standalone projects that
|
|
165
|
+
use ttrl as a library.
|
|
166
|
+
|
|
167
|
+
A chip is exclusive to one process. `device.chip=N` names a physical chip,
|
|
168
|
+
the `N` in `/dev/tenstorrent/N`; leave it unset to take the lowest free one.
|
|
169
|
+
|
|
170
|
+
### Multiple chips
|
|
171
|
+
|
|
172
|
+
`device.chips` trains one replica per chip. Each replica steps its own
|
|
173
|
+
environments and runs its own updates, and every `device.sync_every` updates
|
|
174
|
+
(50 by default) the replicas average their parameters, so they stay one model.
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
ttrl train configs/pong_ppo.py device.chips=4 # any 4 chips
|
|
178
|
+
ttrl train configs/pong_ppo.py device.chips=all # every chip on the machine
|
|
179
|
+
ttrl train configs/pong_ppo.py 'device.chips=[0,1]' # these physical chips
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
config = ttrl.load_config("configs/pong_ppo.py", overrides=["device.chips=4"])
|
|
184
|
+
ttrl.run(config)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
N replicas collect N times the experience per update round, so a multi-chip
|
|
188
|
+
run is a different recipe from its single-chip config, and learning rates or
|
|
189
|
+
batch sizes may need retuning. PPO, which already runs many environments at
|
|
190
|
+
once, is the natural fit.
|
|
191
|
+
|
|
192
|
+
## Deploy without a chip
|
|
193
|
+
|
|
194
|
+
```python
|
|
195
|
+
import ttrl
|
|
196
|
+
|
|
197
|
+
artifact = ttrl.export_policy("runs/pong/checkpoint-best.npz", "pong.policy.npz")
|
|
198
|
+
ttrl.export_onnx(artifact, "pong.onnx") # needs the [onnx] extra
|
|
199
|
+
|
|
200
|
+
policy = ttrl.load_policy(artifact) # numpy only
|
|
201
|
+
action = policy(obs) # obs: one raw observation
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
The ONNX graph has one input, `obs`, and two outputs, `action` and `head`
|
|
205
|
+
(the Q-values or action distribution). It runs with `onnxruntime`, and the
|
|
206
|
+
Atari DQN graph also compiles unchanged with Tenstorrent's TT-Forge-ONNX.
|
|
207
|
+
|
|
208
|
+
## Your own environment
|
|
209
|
+
|
|
210
|
+
An environment is any object with `obs_spec`, `action_spec`, `episode_bound`,
|
|
211
|
+
`reset`, `step` and `close`. Nothing needs subclassing:
|
|
212
|
+
|
|
213
|
+
```python
|
|
214
|
+
import numpy as np
|
|
215
|
+
import ttrl
|
|
216
|
+
from ttrl.envs import check_env
|
|
217
|
+
from ttrl.envs.registry import register
|
|
218
|
+
from ttrl.envs.wrappers import RecordEpisodeStatistics
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class Slider:
|
|
222
|
+
"""Move a point to the origin. Reward is the step's reduction in |x|."""
|
|
223
|
+
|
|
224
|
+
obs_spec = ttrl.ObsSpec.vector(2)
|
|
225
|
+
action_spec = ttrl.ActionSpec.discrete(3)
|
|
226
|
+
episode_bound = 64
|
|
227
|
+
|
|
228
|
+
def reset(self, *, seed=None):
|
|
229
|
+
self.rng = np.random.default_rng(seed)
|
|
230
|
+
self.x, self.t = float(self.rng.uniform(-1.0, 1.0)), 0
|
|
231
|
+
return self._obs(), {}
|
|
232
|
+
|
|
233
|
+
def _obs(self):
|
|
234
|
+
return np.array([self.x, self.t / self.episode_bound], dtype=np.float32)
|
|
235
|
+
|
|
236
|
+
def step(self, action):
|
|
237
|
+
before = abs(self.x)
|
|
238
|
+
self.x = float(np.clip(self.x + (int(action) - 1) * 0.05, -1.0, 1.0))
|
|
239
|
+
self.t += 1
|
|
240
|
+
return self._obs(), before - abs(self.x), False, self.t >= self.episode_bound, {}
|
|
241
|
+
|
|
242
|
+
def close(self):
|
|
243
|
+
pass
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
register("slider", lambda **kw: RecordEpisodeStatistics(Slider(**kw)))
|
|
247
|
+
check_env(RecordEpisodeStatistics(Slider()))
|
|
248
|
+
|
|
249
|
+
config = ttrl.TrainConfig(
|
|
250
|
+
algo="dqn",
|
|
251
|
+
total_frames=4_000,
|
|
252
|
+
eval_interval=4_000,
|
|
253
|
+
log_dir="runs/slider",
|
|
254
|
+
env=ttrl.EnvConfig(name="slider", n_envs=1),
|
|
255
|
+
algo_cfg=ttrl.DQNConfig(batch_size=64, learning_starts=500, buffer_capacity=4_000),
|
|
256
|
+
)
|
|
257
|
+
ttrl.run(config)
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
`check_env` raises on the first contract violation with a message saying what
|
|
261
|
+
was expected. `RecordEpisodeStatistics` is required: evaluation reads each
|
|
262
|
+
episode's score from it.
|
|
263
|
+
|
|
264
|
+
## Tests
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
pytest # host suite, no chip needed
|
|
268
|
+
pytest -m tt # hardware suite, needs a chip
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## License
|
|
272
|
+
|
|
273
|
+
MIT
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
tt_rl-0.1.0.dist-info/licenses/LICENSE,sha256=aqaToBFjIojD0A83WcU6kvLL2L48AFH17gnNa5bS8Zg,1070
|
|
2
|
+
ttrl/__init__.py,sha256=NiYp_UVrlIBe903-H_w1PacU0O7lLQia_3rdHF3lurg,12177
|
|
3
|
+
ttrl/algos/__init__.py,sha256=LfnU2Xco9SrhXswA1NxlmRjzmgYUZMEL0HQkRDMWO5A,1455
|
|
4
|
+
ttrl/algos/base.py,sha256=mLESVOMQKqhTTTgGrBvd6vhvDotEAm0OSk8DZEbUFfE,10939
|
|
5
|
+
ttrl/algos/checkpoint.py,sha256=Wn-r_mcChdqdDXsPB52ZVrTr6fYTvQpREP14p_w-uYs,5360
|
|
6
|
+
ttrl/algos/checks.py,sha256=GiK_xf3x8EXhtqZP9T-8QIlum0bwO_xFXXYqkBogAwo,6003
|
|
7
|
+
ttrl/algos/clock.py,sha256=x46HLoQ9riZIaCwugGyMxjy-Xo1U7y6HVZZHn5GQ4oo,4427
|
|
8
|
+
ttrl/algos/config.py,sha256=Xc46-T2mRdlshiKVHcGc3uFWiQP04iA-74_T0kuN_vQ,5128
|
|
9
|
+
ttrl/algos/gaussian.py,sha256=9pPclEVmfFuHT_6P0dF23egVwy6t1jhfN1J6CFLzfcU,6460
|
|
10
|
+
ttrl/algos/grads.py,sha256=ICjqaHO41uz7yeUNX5sNkCoRApPFNVisRVroRliSfZs,2148
|
|
11
|
+
ttrl/algos/mask.py,sha256=DeQx-qq9AM9kk9JSlze_nIle8K4np0oeSh0jJcrnAaY,7724
|
|
12
|
+
ttrl/algos/offpolicy.py,sha256=ECUxaIGn6q1H_IKU2ZP7Y2SBo7NV0r9006Mhp3ZkQRE,6178
|
|
13
|
+
ttrl/algos/registry.py,sha256=VgMDNFDnTMQZ5G8tmEVUag9AAtQ6EecpX_PlVif7Gxk,2386
|
|
14
|
+
ttrl/algos/scaling.py,sha256=LQQ27yRJqEFoinLrGdEcxEsudYuyooSQixPZBeoKMVE,4418
|
|
15
|
+
ttrl/algos/dqn/__init__.py,sha256=mEvXnqF_859ZxHD1djtYFuEkgslBanz7GbstmyXHq6c,937
|
|
16
|
+
ttrl/algos/dqn/agent.py,sha256=F0TqRZXST7RpwGlTOw3GmAmRAwUr9x743uDRhvAs6IM,12241
|
|
17
|
+
ttrl/algos/dqn/config.py,sha256=PM0aaEOTaDbt-B1Ojmiq7uigqsK06isEFBRxHc0eoW8,7379
|
|
18
|
+
ttrl/algos/dqn/losses.py,sha256=-e-zZUmVqX8RlIv9D2TyT4AMSjjJ5lr7qU4NtLB107o,6620
|
|
19
|
+
ttrl/algos/ppo/__init__.py,sha256=wHYZsCzI_own7rNth4FCfo_-7PH70gEU3W2tG6zRWig,806
|
|
20
|
+
ttrl/algos/ppo/agent.py,sha256=fP_SsiIZBquT293WdsLcxEbbIzdkXHODSjuALMqUw2k,10844
|
|
21
|
+
ttrl/algos/ppo/boundaries.py,sha256=WL372a-IbFL0qUoqAbiew8TJSZVk77Dwb98swC9ozKA,11962
|
|
22
|
+
ttrl/algos/ppo/build.py,sha256=is7KplikNtH--F4MoJu_5eDNBaEfvEGISlAFA078ViU,1509
|
|
23
|
+
ttrl/algos/ppo/config.py,sha256=7VDHuCHczVysFy9pOCD-RQXGlkROyJ9GqJKOsDQqaEM,9548
|
|
24
|
+
ttrl/algos/ppo/learn.py,sha256=oNWgL6CpU0k5g0XaeuI9xK3t6v7_E6srCJefl6ams1k,4717
|
|
25
|
+
ttrl/algos/ppo/loss.py,sha256=YghU8qUupZOFZkWMkpsEqp5sS_TGm1fuvMggzWEAqZs,3593
|
|
26
|
+
ttrl/algos/ppo/partial.py,sha256=OC9673wUGYbjUnJ0obwDaydfacST7-m6e-J612jStzc,11837
|
|
27
|
+
ttrl/algos/ppo/policy.py,sha256=Ko51_G6EE4p8ISXURpJiWTcjJ1dtJbbxKzdB4i7S6TI,9278
|
|
28
|
+
ttrl/algos/ppo/recurrent.py,sha256=bX6O4JLLk1OIo8wmffXpliXq74N7VFPbsE-k4WujUkg,11347
|
|
29
|
+
ttrl/algos/ppo/state.py,sha256=JOvZ3pDyKZptDPdSDLBZBkyQMpo4lbzKeSYPztYCYQU,2709
|
|
30
|
+
ttrl/algos/sac/__init__.py,sha256=ZrG-uq87DpRcCKjgax_bBGrvQu5MQM8sAmN62q8Oe7A,713
|
|
31
|
+
ttrl/algos/sac/agent.py,sha256=LKFoWUfay67xHPUNNi-px2zQv4tkCa8nDQP4MlaIX5M,13972
|
|
32
|
+
ttrl/algos/sac/config.py,sha256=lSa1vZmo-kXery54emnmXcLKbRKQiHlMEMCSrRmv9aY,9652
|
|
33
|
+
ttrl/algos/sac/losses.py,sha256=75x0Qsbt4Q_jGR5EbCrqvIZ_9yaPFvO3iqVYvZ-RIxw,4163
|
|
34
|
+
ttrl/algos/sac/policy.py,sha256=7GLkIrncoRulGCN9IlODcLBykY0VV8MZ_zw40bkl2QQ,2509
|
|
35
|
+
ttrl/algos/sac/step.py,sha256=8pjl-n3_yO1B5g-68T0X3F1TU2wl6jy8QuMBPCPqD3I,5025
|
|
36
|
+
ttrl/algos/sac/targets.py,sha256=cmkTmO6z0PKameC_o66WbkVYPFErQrEjLqX9SCz0tJU,4100
|
|
37
|
+
ttrl/buffers/__init__.py,sha256=UN1UcGMbTeGex3zILgXv60PyPQkomhefOKhxMMGwGT8,988
|
|
38
|
+
ttrl/buffers/boundaries.py,sha256=orzJ-bATBzIBaJgm2Rq3T1db55gInAAiZdWQQKwDge8,4691
|
|
39
|
+
ttrl/buffers/checks.py,sha256=tXu7egNZek_6AF_rDClKBOfSQE1NCCkFpBwZ0ec1Ox0,6137
|
|
40
|
+
ttrl/buffers/indexing.py,sha256=lQ4H2CwPZsztJaV56hCHAw1RQgDCcffzm7g_LYCwWgY,6165
|
|
41
|
+
ttrl/buffers/openepisodes.py,sha256=85TQ39Ww_E4nqV4dBC0DvwaUTT0gBmPOSt52T4bzCzE,2075
|
|
42
|
+
ttrl/buffers/persist.py,sha256=NWsaa-x3SR0wmvk7bsBQO_r33mdzjfDWu7_eXpp9rnU,11912
|
|
43
|
+
ttrl/buffers/replay.py,sha256=8rq_j0tGhe-wxs8BHnkI7Nan6lnM24KshraRdpWyuk0,14038
|
|
44
|
+
ttrl/buffers/replaybatch.py,sha256=z1ch88gyUDYuT75bX4qWEg_xG7Aex5vMTjjzZ9qNlsA,3081
|
|
45
|
+
ttrl/buffers/rollout.py,sha256=Mo6R8D8teh-hY1djFqTkOLhRBiUJArCcjR7Yd2Pt6_M,13714
|
|
46
|
+
ttrl/buffers/samplers.py,sha256=e-7wnV6XlvYmzfrOioJsUu7Fci-3b7C79ukEZIuRi6I,7418
|
|
47
|
+
ttrl/buffers/sampling.py,sha256=F7Nj95EPARP0oE7kl3ctcpsRX71zE7bhNtQqXBtfNSQ,12408
|
|
48
|
+
ttrl/buffers/seqbatch.py,sha256=Z-ODpKv6U5uwA7i0H66UGJqTh3RfsD3BDgIOGbg8oBc,5328
|
|
49
|
+
ttrl/buffers/sequences.py,sha256=kpblyaA_kRlS3bwezLJ02UppSCUFKqeMTLc78-6dkoA,9109
|
|
50
|
+
ttrl/buffers/types.py,sha256=LnSK4TywqTQM0YCvJdJRDJAR0bPa1NaSAyMiCQaESQo,6197
|
|
51
|
+
ttrl/buffers/window.py,sha256=3wW9VIq9rucd_Z_4iQa6MFZRmMS6Rf_4JCg5bC-LfUo,7611
|
|
52
|
+
ttrl/buffers/writes.py,sha256=VwLxIyfsljngRT3GakC4cjrKz35BqDeu6ILJUrkcYN4,3011
|
|
53
|
+
ttrl/cli/__init__.py,sha256=4qkgtd6VPVbhHd33amuRUKdj_ksS08FrozzPu_hHcP8,1537
|
|
54
|
+
ttrl/cli/__main__.py,sha256=mpE6WM6Dwi5PFIzKPFnbEnfHuA7vjlNUhkHc4H4b0VM,129
|
|
55
|
+
ttrl/cli/doctor.py,sha256=7dLHG7pSZsZsuFBm2zH0KGEGbZ-SMhCO6RiXgHMus10,1829
|
|
56
|
+
ttrl/cli/logs.py,sha256=GXhW90wmqWRSlIpWpyrDiuNJ_36Yi5hXQk3c2WQB_94,1929
|
|
57
|
+
ttrl/cli/report.py,sha256=dqJMI7QbSaAwZ2LZ2WWsaqmfrxMI4TBauWJFJ0ukwLE,3241
|
|
58
|
+
ttrl/cli/train.py,sha256=Vw2HyadvpHQZdUYq-xG7DvWOyYMmzo-LKDL9j8t7RG0,8641
|
|
59
|
+
ttrl/cli/probes/__init__.py,sha256=__FC5hZR2z3zDeir996x-VhYj6XOkY1PFOOK8u-Ae2c,76
|
|
60
|
+
ttrl/cli/probes/_ttnn.py,sha256=JyAvacHDhQofOHkFNbADt6nvyof7pt0vyRsknSpYJaI,780
|
|
61
|
+
ttrl/cli/probes/chip_report.py,sha256=6tAsoA77TrQWLNyVf0TypsD-sEzGFH00f0l2txj-61Y,3168
|
|
62
|
+
ttrl/cli/probes/chips.py,sha256=QYS5Nr0-jLg1uen2EE121tGr3MrY3SOra8XYTnvK3w4,3486
|
|
63
|
+
ttrl/cli/probes/extras.py,sha256=7Cs_LNTIlMTTsDg_buT5d-72l8vzlZtukVDko90MYt8,2130
|
|
64
|
+
ttrl/cli/probes/hardware.py,sha256=zeQm7SCn7PZgmu1KRzRrjwnBpTBF6gBOuYGMRupe7ow,6002
|
|
65
|
+
ttrl/cli/probes/traps.py,sha256=ypoxK8lngR02eE0tSOOpMbWsyzxE_InrZn0UOZV1X3M,2919
|
|
66
|
+
ttrl/cli/probes/versions.py,sha256=FcwsrTp01yKqwwVg1UQoO-bssQRFKkMkq1EWwctQ_fQ,8385
|
|
67
|
+
ttrl/deploy/__init__.py,sha256=XrcbOeuDab1gZftkabqQslnSVcESWw9_AjJ3NbmUPJ4,1734
|
|
68
|
+
ttrl/deploy/artifact.py,sha256=o5hjZyfbTLtLF3lzr5x5V6oQ0CLA73by24kZCmc3UtE,13617
|
|
69
|
+
ttrl/deploy/conv.py,sha256=-nQRrgpSC731VtHIETZcr0IjwrzORqNW8Bo7lPDVxcs,3070
|
|
70
|
+
ttrl/deploy/export.py,sha256=ySlPgIdZmpLVRJCLpnEUyS0wYUgSsxPfXoGikr2gUv8,12106
|
|
71
|
+
ttrl/deploy/graph.py,sha256=Scai1mT1ziKqwlB1Enf7jmA1NhgSyPfHzrnrYVUJhmQ,13310
|
|
72
|
+
ttrl/deploy/policies.py,sha256=L7RuFwTotRQYAEh4vlKKR-CQrib7IrHkPsvEZTI-HpM,4840
|
|
73
|
+
ttrl/deploy/read.py,sha256=m_zBb6NM5mV9G51AqWlVQiqigNCZIJkhNfqnXhxDhQk,3371
|
|
74
|
+
ttrl/deploy/towers.py,sha256=jCvvo4aWrL73rA5ucn_7GHVG7dahkafwUnzrfH3eVXE,3634
|
|
75
|
+
ttrl/deploy/transform.py,sha256=xOch9d6zOBSSadYwMDUqV071OP8DJb1J7R-5FH0Sx_A,5321
|
|
76
|
+
ttrl/engine/__init__.py,sha256=jO1DLrXPONsiR0G6bdiiruj15pYxz-UQ2F69tDfQWC8,2896
|
|
77
|
+
ttrl/engine/autograd.py,sha256=f25LZMrT8Vc9sGYIhi7xeCKWtr8T1adGwSqzjwlZTh4,9303
|
|
78
|
+
ttrl/engine/carry.py,sha256=2kYQADmo26H4Omz94ymjA3YyhAxYnCgYys-Nmmc-af0,7483
|
|
79
|
+
ttrl/engine/config.py,sha256=hGI5euctOY_oMB-SWhfpDoHC9cEgn1wYowO4WaG4uXo,802
|
|
80
|
+
ttrl/engine/layers.py,sha256=1Jv8UgorzC-5045pRBBh9Lz8a8BsZyAhYh129A2g9-Q,7601
|
|
81
|
+
ttrl/engine/recurrent.py,sha256=ek_unYkIZjf0QdumsCTLEV3eN83DU593JL6O0oxlXoo,7826
|
|
82
|
+
ttrl/engine/trace.py,sha256=pFD0n8aowclm473rQL4usWHWRe6W77Bk1q6jFBeEhZE,4690
|
|
83
|
+
ttrl/engine/conv/__init__.py,sha256=_xhBTS9E6rbpMm-gNAWnWw-Cjaia04dsAo6_2w6p5nA,2379
|
|
84
|
+
ttrl/engine/conv/backward.py,sha256=CrKNHJeluMOPIFYIPqV0EeqyCUo7BdrDIkXeNZUABAk,3329
|
|
85
|
+
ttrl/engine/conv/config.py,sha256=mTf8cLkpSr7UZP0KgSjB6JnFqEAdTDzf2iCirEf1u_M,6851
|
|
86
|
+
ttrl/engine/conv/forward.py,sha256=cigy9V15Yw6UYo8StvNZYmjoYC3Rpra55TsUtkX1BHY,8772
|
|
87
|
+
ttrl/engine/conv/geometry.py,sha256=Wj6QDbOLquV__lKOJbSe2cu2WbdtrF9aFwtkWdF32Rc,12564
|
|
88
|
+
ttrl/engine/conv/module.py,sha256=BCsC6o0VDiMH7bFhywPBqR5EjhrqyRwuRQPG5bPN9Oc,12320
|
|
89
|
+
ttrl/engine/conv/packing.py,sha256=LV9GhuFsI10tGRg1RMjFzoJ2EmFR04cAyze5W5O2ta8,7682
|
|
90
|
+
ttrl/engine/conv/transform.py,sha256=bh79adi8-DZ2xMPeUX7GWZL-jb9sihdXrxfaJOP-0Yw,11407
|
|
91
|
+
ttrl/engine/conv/weights.py,sha256=JN5_ZR7lc1aA_ali_EgnQO8vvhff9Dp5ggfsn-w1KQA,10303
|
|
92
|
+
ttrl/engine/device/__init__.py,sha256=ipuSRvje5jPk-qRSHZtGScxyxT_aSo09iuOTHKh-kYY,1633
|
|
93
|
+
ttrl/engine/device/acquire.py,sha256=vBetek8j6xZ6wu0a7m1gzXLasIrqkUXWNi9uhVdvo1M,5202
|
|
94
|
+
ttrl/engine/device/liveness.py,sha256=QzQazYQoHlsjYUa4AohJM1z1Yk04aCat376DTkAPsiw,11055
|
|
95
|
+
ttrl/engine/device/profile.py,sha256=yPNrLdKTpg2GLcA36FSLr5pucX55PWQIxdwLT1tnbDg,2443
|
|
96
|
+
ttrl/engine/device/scope.py,sha256=54rW6Bh-LzQSO_cBck5pcUSqPejFFiSaF-3DiunLcOs,9541
|
|
97
|
+
ttrl/engine/mesh/__init__.py,sha256=Gj7vFV5NQYm2d3CfYVjR9XFqKhCVYGoZ4doQWT7LdLc,1235
|
|
98
|
+
ttrl/engine/mesh/devices.py,sha256=WGTs2RYGcjZ0VnCfAj_-JzUoJC008TeR2QWRAXSNmno,4811
|
|
99
|
+
ttrl/engine/mesh/open.py,sha256=IjJVsHRyD7AShIpAdYlaymmPyFwRruOWR5CV0kDiUI0,7885
|
|
100
|
+
ttrl/engine/mesh/resume.py,sha256=aRBd6dmLRj82U7LQh_NtGD4hgWotaJIKACSWq1jXQIg,4565
|
|
101
|
+
ttrl/engine/mesh/sync.py,sha256=Mw29F0wW9AeFloQSx7f86LlBXp-4UvVam1ufakrk87w,12175
|
|
102
|
+
ttrl/engine/mesh/topology.py,sha256=ApE2OLQ-zcZWOrTuSSld0FUD4TjpzaQHdaoC85LQmyE,5084
|
|
103
|
+
ttrl/engine/nn/__init__.py,sha256=CYjTdJFdrqxUoqa3gV6VxKiW7elH5iNI95NsX9IFF5I,228
|
|
104
|
+
ttrl/engine/nn/containers.py,sha256=3zLxyaDC8yeiDTO58FK_wIiJLgo8_YQIi7d8B9hoqbY,2476
|
|
105
|
+
ttrl/engine/nn/discovery.py,sha256=TOWy26RWv-6zagmwS_esb2ASxl107nw9kf7PuM7ftlI,6545
|
|
106
|
+
ttrl/engine/nn/module.py,sha256=YWLyXGBYrYzkA1QOJl7c83xa5I0YjE_DeE9GtJ8OjRg,8271
|
|
107
|
+
ttrl/engine/ops/__init__.py,sha256=S5ZWLHfqdpPBruGIL6xcmm3iOjBi98_m0ZeMuhxumXE,1275
|
|
108
|
+
ttrl/engine/ops/broadcast.py,sha256=MC2GN8J-5BFW3l3wUt7Ora2j1zepIZNNL7cNi10ILeQ,1975
|
|
109
|
+
ttrl/engine/ops/elementwise.py,sha256=-c3nCn358BOnu5udeJBNF69dB3wJoKuLB60UlhnX4SU,4477
|
|
110
|
+
ttrl/engine/ops/functional.py,sha256=xfk9AE4_nNL1ydc6mFBXNtNq-lReRFyg1A3qdGJfjrk,7878
|
|
111
|
+
ttrl/engine/ops/matmul.py,sha256=vV22l6IME5Xipdq3PdOZQYlZmrkLsbywgFbrfPtkYWk,3540
|
|
112
|
+
ttrl/engine/ops/reduce.py,sha256=Wa4-vSAWu5tdjPo-m-CxGJh10eoPU2uwDHlYn_icryE,3693
|
|
113
|
+
ttrl/engine/ops/select.py,sha256=yOTLO2w4n2JbkQUSbopxj7xjSkVZv2K3bb5hTJJxxhY,2917
|
|
114
|
+
ttrl/engine/ops/shape.py,sha256=GMe8iFH6cPHFmv-XycyEWMJkMY0PKrhcHIiJpPIuhRY,5546
|
|
115
|
+
ttrl/engine/ops/unary.py,sha256=fFvmp7O46z-5Zx74iFKnAODCppOZ0KPZ_P5tOmppzu8,3991
|
|
116
|
+
ttrl/engine/optim/__init__.py,sha256=YxlBt8K9itG_m4oBbrTZBbqFP50Et5BXs2IW_ifIGO8,274
|
|
117
|
+
ttrl/engine/optim/adam.py,sha256=PZKHK6kJ7EQ_3eOxRkChHh9bfmSNdksehj_M-r2Ds3Q,5985
|
|
118
|
+
ttrl/engine/optim/base.py,sha256=zncyZUnbWYnH_EDRM9CAhV2vkViz0bYce7O7dtY0Ufs,355
|
|
119
|
+
ttrl/engine/optim/checkpoint.py,sha256=VDD1JTaT8MO69fEjtbeH9u1UupWrkWN6zcaPSOYQAJs,4672
|
|
120
|
+
ttrl/engine/optim/scalars.py,sha256=vyt2qAMbaA38UvM0s0A6rmIJktjiotmw1gBn96NszFk,931
|
|
121
|
+
ttrl/engine/step/__init__.py,sha256=kJee1YnFLw29_9gdLQVQubdCCWzax1diDvtHxN0XrTA,292
|
|
122
|
+
ttrl/engine/step/core.py,sha256=wONI_y5yMNDIzMYYJ-krK1U0RejfBng4rPQJQL25Ka0,6128
|
|
123
|
+
ttrl/engine/step/inputs.py,sha256=37IDtErJsPV98Jzx3SxZNztdaRrYChQGTpmx6Sz0G_U,4138
|
|
124
|
+
ttrl/engine/step/metrics.py,sha256=WzK1DVDE299iH431Dm617PxK2r1nbrXeqyo7md5lEkI,4424
|
|
125
|
+
ttrl/engine/tensor/__init__.py,sha256=AblzepeTFDkN4n6GTi8O4wVKBLiv4eqDTRwE3Pa9p5A,795
|
|
126
|
+
ttrl/engine/tensor/arena.py,sha256=HDngQ-0tyfbSTK7ATLzPQBDHxhx24H56-RYDYdaf7vE,3202
|
|
127
|
+
ttrl/engine/tensor/precision.py,sha256=U6SRBh-XcQCNzCouE5yJ7-K-ZKqEGUj2bkUeJD8CkGA,1153
|
|
128
|
+
ttrl/engine/tensor/transfer.py,sha256=-31AvHRQgnFCQ1yiJFeNi1kQ88R0s3sefKxtT3UuACg,2025
|
|
129
|
+
ttrl/envs/__init__.py,sha256=fVELOt6iH3t3MTSquRJTSD6emR2scjTx7ceGgchuAGM,3143
|
|
130
|
+
ttrl/envs/_children.py,sha256=fUt1StqO_mL2349fH2craavPrlF5_neyW7elfmyo1W4,5512
|
|
131
|
+
ttrl/envs/_worker.py,sha256=uNJWtT7PAVP0zBtsgP0mCvQ1_m-eur1NF95JULiwI_M,3292
|
|
132
|
+
ttrl/envs/base.py,sha256=gX5siSy4CjvuvbgRKDL_Phc_LBFMKIyIzo6Nqq__l3o,8559
|
|
133
|
+
ttrl/envs/bounds.py,sha256=CQGzgtp7FHExvj8yhUMM1RLdChoqU07G0q7eyeNcRXA,4570
|
|
134
|
+
ttrl/envs/check.py,sha256=VQYuZ0UEpTSFEdbDju-eNyosHR8xpYgd4T3Z1SX2j_8,8584
|
|
135
|
+
ttrl/envs/check_clauses.py,sha256=bfNlW5yukIyAf4fMpvlp2RndXvFgDzgI3SQg0dm2ycQ,9366
|
|
136
|
+
ttrl/envs/episodes.py,sha256=e-8o6jXC5OFkQqkAVinnDlSkyHt529dh240xvdQX4KU,5378
|
|
137
|
+
ttrl/envs/gym_adapter.py,sha256=wjPQbBhNjooys44hrwbEJsaMFdHYOxiTANvQp2k2RmI,5959
|
|
138
|
+
ttrl/envs/mujoco.py,sha256=usKYZ7cNs1OlxsgzNRPs9cvg4ZaaB-6FlqyrKkdb-Cc,9680
|
|
139
|
+
ttrl/envs/obs_batch.py,sha256=Ic2DMZf8itSaSVXJiSMAGyktfexnZycMkJuHVial4bU,2913
|
|
140
|
+
ttrl/envs/registry.py,sha256=v7F3u8P1pWLguSwHwmHRUg-mU4VLOvYdIBxezdfwPXM,3962
|
|
141
|
+
ttrl/envs/render.py,sha256=2HRvr-It8OlusqrgDrY2SRI3lDXUjbW4wftF6ls0hHg,3250
|
|
142
|
+
ttrl/envs/running.py,sha256=UHMILIMcjC-lhkLUJptJyP50EwJEno36yAYvxqPGQi8,4891
|
|
143
|
+
ttrl/envs/vec_normalize.py,sha256=fQdRQEBySZRHBLPSMVcsd9MfuoZbdAI7ixdCZ8dNcxQ,13480
|
|
144
|
+
ttrl/envs/vec_wrapper.py,sha256=DUz4-gyPacfY8aN9bNZlhbJ-6BfUcZUcM9LiJwpHtu8,5777
|
|
145
|
+
ttrl/envs/vector.py,sha256=7okRBfc7qg108KLo-gXkGEBzjBA-Au3iVzIS2oTAnPA,8867
|
|
146
|
+
ttrl/envs/vector_async.py,sha256=URi20TkbO6aaBytmVzBSME6ekVKPATLAPxZRkrjrHEw,8372
|
|
147
|
+
ttrl/envs/atari/__init__.py,sha256=YIVGRnLLl5IgRmDZK976Ng2gck7PCcb5tOHolpTQpRA,5511
|
|
148
|
+
ttrl/envs/atari/emulator.py,sha256=yRHMplwQ16nRDoFisd_pHvDDsdRN4WSv-6iuQHYtbkc,3031
|
|
149
|
+
ttrl/envs/atari/wrappers.py,sha256=wLxRnzDK9OW-kc8GwsvOB1PlXH3LNOF0B2r4szRbvbs,8307
|
|
150
|
+
ttrl/envs/wrappers/__init__.py,sha256=Fid4ZO4W77CY8ez-qPKFUwrXh_s2fMpvOfiyE14-NTA,1194
|
|
151
|
+
ttrl/envs/wrappers/control.py,sha256=GVYcVNOKeKruSykgvbkyFU2mRyv59HjrICAtghNE7WA,4930
|
|
152
|
+
ttrl/envs/wrappers/core.py,sha256=l0kNV41gnM6uMuYguGpF_SRqWlUM5LV5-kJSFBmDhA0,11702
|
|
153
|
+
ttrl/envs/wrappers/leaf.py,sha256=m3Ste0A_AjqnewbM1g-SV74k05uGee_oc26efmKIkl8,3418
|
|
154
|
+
ttrl/envs/wrappers/observation.py,sha256=WOUBzvZ8znUFtl6OqAEwcJw_zK1EQmiLdbfPKBM8_Ig,4906
|
|
155
|
+
ttrl/envs/wrappers/privileged.py,sha256=eRlO4V3hxseGUCuRrGTya2zz1k7B6I0kZ33lH1OWHZg,2953
|
|
156
|
+
ttrl/envs/wrappers/reward.py,sha256=_sKj9VuLO8qB6MIjbw91KVYYeoNxwRVCXIWtFSH65fM,2117
|
|
157
|
+
ttrl/nets/__init__.py,sha256=JkLf8SU6beZHr9DVGsKOBTCYPI0euKWd8YW_F0H3W-Y,3493
|
|
158
|
+
ttrl/nets/acting.py,sha256=Dy7P2QLASGYo-4LRv5T19oBLQHvfHra7feKOJdfjJw4,8152
|
|
159
|
+
ttrl/nets/build.py,sha256=ND4gVpFVQjROwaSn4SThzRohdxNWYu2DUK-GLuvwLy8,10966
|
|
160
|
+
ttrl/nets/choice.py,sha256=uK69j9sIw8hojkZfvXiRCz0KHcBvd16gUhPVCjMSdgs,5960
|
|
161
|
+
ttrl/nets/encoders.py,sha256=SHapLCq3YsanV1y7xCVBA1uIN-tVz5xv5EEBDkvu0lI,11137
|
|
162
|
+
ttrl/nets/fusion.py,sha256=ojy6yBGUtfIYEidWJBTICBXEgiCx2L3YsRogyiP2TMc,3489
|
|
163
|
+
ttrl/nets/heads.py,sha256=6xtpuh9BBogy9BM0uggs_4zO9xmFfF2rxmCPoN0Hi_c,4292
|
|
164
|
+
ttrl/nets/models.py,sha256=RiG3tdKRuL9pDsNL44r-MoYa7npRa3ckRagqVFMbiuE,5447
|
|
165
|
+
ttrl/nets/multi.py,sha256=OC9F8q-l4X6WYOQslsZY5tBQyzxuocwHHGS6mQUbaaw,6733
|
|
166
|
+
ttrl/nets/obs.py,sha256=IKaP66xDoy2DB51Pk4cTfLkjxGySOGvO96vxOsxzpkc,8806
|
|
167
|
+
ttrl/nets/recurrent.py,sha256=iC1p9v0VP9BeRJuNXOdChTNcIvXTSrtXbjTsLXwAcaQ,9761
|
|
168
|
+
ttrl/nets/registry.py,sha256=l1BYqq13Ee0P425A_yimBAFijUpoFbkrVB8NQ6KtHSU,11079
|
|
169
|
+
ttrl/nets/towers.py,sha256=hn0iS6zJUhXckhePrsc7x-CYxKBgoHqOkOz9PRL-chk,2682
|
|
170
|
+
ttrl/spaces/__init__.py,sha256=-eT__0TBvJsKjMVuOjWM869SR_ohGPLrCuXIuICivG0,1455
|
|
171
|
+
ttrl/spaces/action.py,sha256=pNj-HAkYoXIzDBtp4aAD1kwrlM9bd75CrOvJtkTakOc,7087
|
|
172
|
+
ttrl/spaces/fields.py,sha256=xzlO7Ws5ziZNkpVU8mvtntXPKPIcbBYI1Dv7QUfIWhg,3822
|
|
173
|
+
ttrl/spaces/group.py,sha256=aJeom-rg2qrITTKnFBnlZwyF2XWetdIIWT9Rsqs1_5w,9890
|
|
174
|
+
ttrl/spaces/mask.py,sha256=HwUP5GE2nrPGlHog3PE2piBoUb0MDtBNrYfvexJV9Lw,3822
|
|
175
|
+
ttrl/spaces/obs.py,sha256=PKfGEiyajIW2cwekQ1BfzIQQ-eiUgEwEBgyhYuKykIA,12393
|
|
176
|
+
ttrl/spaces/observation.py,sha256=rEDm5HsIIleXNj9OvdyplpRQ6DM5yJmEjPrAFTNhyf0,9806
|
|
177
|
+
ttrl/spaces/refusals.py,sha256=QGwyY09HgK5dlE5M2ejZuXaANBdS4OcXGkmHeRMtzt0,3906
|
|
178
|
+
ttrl/train/__init__.py,sha256=kI44RefqpthxVNaWnSqJRmIseP5d17bmrynTSrvBHSQ,1834
|
|
179
|
+
ttrl/train/builders.py,sha256=ot_NKUYPPoAjAtuHqWEPL1QDARSroOXHz4TRM_dCDCg,6171
|
|
180
|
+
ttrl/train/cadence.py,sha256=nMY5p_K34quFpsufDTY7au1MLNmxcuGdbRsLQSUYiPs,12386
|
|
181
|
+
ttrl/train/device.py,sha256=VC71R9SqMfmX9xHA_c2G5c3vMUC20hanabKe0pOAm18,3063
|
|
182
|
+
ttrl/train/eval_checkpoint.py,sha256=XTVsCQ12LJih3okkwdy1ovIWZoWLkF_jJNwaj80iwVE,5026
|
|
183
|
+
ttrl/train/eval_metrics.py,sha256=palOrEebaUogoUhx6dNh81aJZQx43GFF2yVhb4O1uf8,3067
|
|
184
|
+
ttrl/train/evaluate.py,sha256=oQ0YpZDF4mHEvyeNqWAvyJybMbgpOROZ1q99dQoMAQA,10512
|
|
185
|
+
ttrl/train/film.py,sha256=RCKtcL2rr08PIeL8_Xy6TZuVC4bVSq2IB0FI0AlW33E,8466
|
|
186
|
+
ttrl/train/gitstate.py,sha256=-_L5tSS1c-cHrEWhhXGkMirpf8_3EDz7yoHaIQ0BFj0,5942
|
|
187
|
+
ttrl/train/hooks.py,sha256=QME9XPUSMtVl9lHi9xcNGNBT1GEt1RixBUtrQe6WNjo,2825
|
|
188
|
+
ttrl/train/logging.py,sha256=jXrQMo6SXz5Ii-XzF6zbN9x_VHa0e2ryMPdY4vzySgw,11160
|
|
189
|
+
ttrl/train/loop.py,sha256=4jxgQ5sCPOrWen1YO7-UoAaEiZtwivk5MEZJgbKG4Z0,11564
|
|
190
|
+
ttrl/train/periodic.py,sha256=PLCspbDY8aYMkPcuj2HdipczpDs4mxqLmAxQk87oc7k,3351
|
|
191
|
+
ttrl/train/provenance.py,sha256=Y56-7SQ2Hv67hOwvw5FP3X1T2lg5Y9IXM92xDCQhrUw,8640
|
|
192
|
+
ttrl/train/record.py,sha256=-iXE8z3rNOxqac8trS6xYq1a9K4PL00Kj9kx61JM5RQ,11203
|
|
193
|
+
ttrl/train/record_env.py,sha256=Pdqdh06R51VkmCddQl8Me577oCdFvl3T5Zz7ZOJqzVs,2766
|
|
194
|
+
ttrl/train/replicas.py,sha256=BfyBQ_G56flNHWI_-aW_rVa2rruOw-6xN96llG8D77g,12532
|
|
195
|
+
ttrl/train/restore.py,sha256=LIkOXiAlGA-Fjd7q_QE2ztMNGS3aqXF5b4C6GaygH2M,5232
|
|
196
|
+
ttrl/train/resume.py,sha256=p1JC_g3a-u6X-mPue5imF-CNqo5y6Dy852M2ecxCCZQ,10988
|
|
197
|
+
ttrl/train/resume_env.py,sha256=8ApGAmMGamyHSvNkeNUNuP16IQ9pFc4rYZHHGsg7Ehc,8375
|
|
198
|
+
ttrl/train/run.py,sha256=d3kxLS_s8lIzv0_cuY3iNagraEhm3VpnIbUqy2ixTcg,4327
|
|
199
|
+
ttrl/train/scoping.py,sha256=TCVIkVwym_bBSD2dfkRmqbQ8OXLqake_QT_lP4C1ee8,4564
|
|
200
|
+
ttrl/train/snapshot.py,sha256=baZRIsesaUEoZecsegdL4I62L6MWPayQAZBR8Md5kRM,6163
|
|
201
|
+
ttrl/train/stop.py,sha256=9PcLL-EXbMHmlnRpOqTFqxJbFNAwqHrHfySPG3GLqe8,5112
|
|
202
|
+
ttrl/train/teardown.py,sha256=Idqqn2qNApMgY_dYSxKCTuDJf7VxEARGHkkvkEevAxI,5461
|
|
203
|
+
ttrl/train/throughput.py,sha256=lffxsQu0MRCae2FZeKntmuaXQ_JLL-arOBaOLBPPtRM,1949
|
|
204
|
+
ttrl/train/trackers.py,sha256=jkY7w0irjsTcX6eGsVGV8hpUrc-xsZFgu9FOG94pPKM,4925
|
|
205
|
+
ttrl/train/trainer.py,sha256=xQ8z9gnj5gQjhCuqGie4g1_uDc1Hl8Wz_h7IvGUNS00,13418
|
|
206
|
+
ttrl/train/video.py,sha256=T_jWsqwwkkUqxYPVUFFAYUIHE5aUbfDAjNu4U_zRESw,1682
|
|
207
|
+
ttrl/train/checkpoint/__init__.py,sha256=fbJ-v1HElEAlvHpPJRQ5PGw-ZejNCsojxS6_dG2vUio,1354
|
|
208
|
+
ttrl/train/checkpoint/atomic.py,sha256=Y1dK46RJJrPw3QOyB_74sGED9-apWySZKfOw6-K0adg,1253
|
|
209
|
+
ttrl/train/checkpoint/best.py,sha256=3EwQxgQnKOdpT9e92QTlsGefwDAAKuFY7lBBMt0VxmY,12346
|
|
210
|
+
ttrl/train/checkpoint/file.py,sha256=XXSo7LTKkDjZgLX9dpxZFnz4B3LUeIH66wzGmHVS4pM,10347
|
|
211
|
+
ttrl/train/checkpoint/history.py,sha256=gM0sXAR0b_7G0lLBR8tsunYvuM8Gnm2A4w-ZqWImLaU,3879
|
|
212
|
+
ttrl/train/checkpoint/read.py,sha256=POS01E12wV8s_FB_7sc29TvxAa2romINjbdFMTrG8p0,4550
|
|
213
|
+
ttrl/train/checkpoint/retype.py,sha256=fzZuKKyDrOjyWPDjiZ1PDVGRNoxsYfuc4yMmQ2WyuDU,1751
|
|
214
|
+
ttrl/train/checkpoint/specs.py,sha256=tjoIzehwONFeFreUZeq2aWLT9_683OFGNFurP0u5EX8,2182
|
|
215
|
+
ttrl/train/checkpoint/tree.py,sha256=FEeJPQ9OjoC6nNoPHBVv7tTTYOo8G4X0BfLhriyeEgE,12397
|
|
216
|
+
ttrl/train/checkpoint/types.py,sha256=9Zt-ERE_w2WovvHKcO2vBPWVyWKSK5BS86Re54GDuTE,2887
|
|
217
|
+
ttrl/train/config/__init__.py,sha256=W7TZMLztJ2gX1CflfUs5lVfLv8-6sGkE45F0ZrrvwUc,788
|
|
218
|
+
ttrl/train/config/coerce.py,sha256=PK7WFpq9YlbYMpKE2JBWliNk2DvVLSgVP5Va1W1Rt7k,9568
|
|
219
|
+
ttrl/train/config/device.py,sha256=FYA9dBHrtU2dj3Nmvp4HRQQMMBEFBcg3C9qzB3X3QQg,5509
|
|
220
|
+
ttrl/train/config/env.py,sha256=hiaN-KRvBWKqJUbMzbnxLVZtKkbkpz8xnJ01Y1uwz2g,7418
|
|
221
|
+
ttrl/train/config/horizon.py,sha256=PbdtQskZ28HPMGsSw9E796dhiXhRXCja5IV3SyX7xW4,3666
|
|
222
|
+
ttrl/train/config/loader.py,sha256=_2LvvdbFuIuXzfKGSEbqDSowFvHL5D39Z8h7mPcvnpw,7224
|
|
223
|
+
ttrl/train/config/overrides.py,sha256=xJglLZRpFHh6DQvXAgQP5b7fF9_eHux2Am_er8G8lHg,5341
|
|
224
|
+
ttrl/train/config/schema.py,sha256=nJsAzVoTtVCeEA_Pe0lR5-ChN9KfzJiUREy-jBpJeVo,14591
|
|
225
|
+
tt_rl-0.1.0.dist-info/METADATA,sha256=UK3xY2v19EQXsq3S0e31fQ7NfnffJNYhcLiea3hC3T4,10186
|
|
226
|
+
tt_rl-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
227
|
+
tt_rl-0.1.0.dist-info/entry_points.txt,sha256=No_fB11K8KnVCsilaalBDK5qJNJBSguqZSWCcM3lRwo,39
|
|
228
|
+
tt_rl-0.1.0.dist-info/top_level.txt,sha256=nC4_DvwFyIGmY5-Gb8vAmy7fDGV6J4g811X64MbhzC8,5
|
|
229
|
+
tt_rl-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Antoni Bertel
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ttrl
|