Skip to content

Commit cc381ab

Browse files
Merge pull request #20 from RadarML/dev/compile
Compile Overhaul
2 parents c73a24e + 996e082 commit cc381ab

30 files changed

+570
-1510
lines changed

docs/grt/index.md

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,47 @@ The GRT reference implementation uses a [hydra](https://hydra.cc/docs/intro/) +
1010
2. Create a virtual environment in `nrdk/grt` with `uv sync`.
1111
3. Run with `uv run train.py`; see the hydra config files in `nrdk/grt/config/` for options.
1212

13-
!!! info "Pre-Trained Checkpoints"
13+
## Pre-Trained Checkpoints
1414

15-
Pre-trained model checkpoints for the GRT reference implementation on the [I/Q-1M dataset](https://radarml.github.io/red-rover/iq1m/) can also be found [here](https://radarml.github.io/red-rover/iq1m/osn/#download-from-osn).
15+
Pre-trained model checkpoints for the GRT reference implementation on the [I/Q-1M dataset](https://radarml.github.io/red-rover/iq1m/) can also be found [here](https://radarml.github.io/red-rover/iq1m/osn/#download-from-osn).
1616

17-
With a single GPU, these checkpoints can be reproduced with the following:
17+
With a single GPU, these checkpoints can be reproduced with the following:
1818

19-
=== "Base Model"
20-
The 3D polar occupancy base model is provided as the default configuration (i.e., `sensors=[radar,lidar]`, `transforms@transforms.sample=[radar,lidar3d]`, `objective=lidar3d`, `model/decoder=lidar3d`).
21-
```sh
22-
uv run train.py meta.name=base meta.version=small size=small
23-
```
19+
=== "Base Model"
20+
The 3D polar occupancy base model is provided as the default configuration (i.e., `sensors=[radar,lidar]`, `transforms@transforms.sample=[radar,lidar3d]`, `objective=lidar3d`, `model/decoder=lidar3d`).
21+
```sh
22+
uv run train.py meta.name=base meta.version=small size=small
23+
```
2424

25-
=== "2D Occupancy"
26-
```sh
27-
uv run train.py meta.name=occ2d meta.version=small size=small \
28-
+base=occ3d_to_occ2d \
29-
sensors=[radar,lidar] \
30-
transforms@transforms.sample=[radar,lidar2d] \
31-
objective=lidar2d \
32-
model/decoder=lidar2d
33-
```
25+
=== "2D Occupancy"
26+
```sh
27+
uv run train.py meta.name=occ2d meta.version=small size=small \
28+
+base=occ3d_to_occ2d \
29+
sensors=[radar,lidar] \
30+
transforms@transforms.sample=[radar,lidar2d] \
31+
objective=lidar2d \
32+
model/decoder=lidar2d
33+
```
3434

35-
=== "Semantic Segmentation"
36-
```sh
37-
uv run train.py meta.name=semseg meta.version=small size=small \
38-
+base=occ3d_to_semseg \
39-
sensors=[radar,semseg] \
40-
transforms@transforms.sample=[radar,semseg] \
41-
objective=semseg \
42-
model/decoder=semseg
43-
```
35+
=== "Semantic Segmentation"
36+
```sh
37+
uv run train.py meta.name=semseg meta.version=small size=small \
38+
+base=occ3d_to_semseg \
39+
sensors=[radar,semseg] \
40+
transforms@transforms.sample=[radar,semseg] \
41+
objective=semseg \
42+
model/decoder=semseg
43+
```
4444

45-
=== "Ego-Motion"
46-
```sh
47-
uv run train.py meta.name=vel meta.version=small size=small \
48-
+base=occ3d_to_vel \
49-
sensors=[radar,pose]
50-
transforms@transforms.sample=[radar,vel] \
51-
objective=vel \
52-
model/decoder=vel
53-
```
45+
=== "Ego-Motion"
46+
```sh
47+
uv run train.py meta.name=vel meta.version=small size=small \
48+
+base=occ3d_to_vel \
49+
sensors=[radar,pose] \
50+
transforms@transforms.sample=[radar,vel] \
51+
objective=vel \
52+
model/decoder=vel
53+
```
5454

5555
!!! tip
5656

@@ -119,6 +119,13 @@ The GRT template includes reference training scripts which can be used for high
119119
--8<-- "grt/train_minimal.py"
120120
```
121121

122+
!!! info "Compile the Model"
123+
124+
You can invoke the pytorch [JIT Compiler](https://docs.pytorch.org/tutorials/intermediate/torch_compile_tutorial.html) by setting `meta.compile=True`. Since the pytorch compiler is kind of janky and causes issues with type checkers, you will also need to set
125+
```sh
126+
export JAXTYPING_DISABLE=1
127+
```
128+
122129
## Evaluation Script
123130

124131
::: evaluate.evaluate

docs/index.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,31 +55,33 @@ The NRDK is intended to be used as a library; we recommend installing it as a su
5555

5656
```sh
5757
git submodule add git@github.com:RadarML/nrdk.git
58-
uv pip install -e ./nrdk[roverd,grt]
58+
uv pip install -e ./nrdk[roverd]
5959
```
6060

61-
=== "Development"
61+
=== "Via `uv` + `pyproject.toml`"
6262

63-
```sh
64-
git clone git@github.com:RadarML/nrdk.git
65-
cd nrdk
66-
uv sync --all-extras
67-
uv run pre-commit install
63+
```toml
64+
[project]
65+
dependencies = ["nrdk[roverd]"]
66+
67+
[tool.uv.extensions]
68+
nrdk = { path = "./nrdk", editable = true }
6869
```
6970

70-
!!! tip
71+
=== "For Development"
7172

72-
If authenticating with a github token (i.e., `https`), translate all `ssh://git@github.com` authentication to `https://github.com` with
7373
```sh
74-
git config --global url."https://github.com/".insteadOf ssh://git@github.com/
74+
git clone git@github.com:RadarML/nrdk.git
75+
cd nrdk
76+
uv sync --all-extras --frozen
77+
uv run pre-commit install
7578
```
7679

7780
??? info "Extras"
7881

7982
The NRDK library also includes the following extras:
8083

8184
- `nrdk[roverd]`: support for loading and processing data using the [roverd](https://radarml.github.io/red-rover/roverd/) format (i.e., as collected by the [`red-rover`](https://radarml.github.io/red-rover/) system).
82-
- `nrdk[grt]`: extra dependencies for our GRT reference implementation, which uses a hydra-based configuration system.
8385
- `nrdk[docs]`: a mkdocs + mkdocs-material + mdocstrings-python documentation stack.
8486
- `nrdk[dev]`: linters, testing, pre-commit hooks, etc.
8587

@@ -123,6 +125,12 @@ uv run pre-commit run --all-files
123125

124126
abstract interface for composable dataloaders and preprocessing pipelines
125127

128+
- :fontawesome-solid-hexagon-nodes: [`grt`](https://wiselabcmu.github.io/grt/)
129+
130+
---
131+
132+
*our latest work, GRT: Towards Foundational Models for Single-Chip Radar*
133+
126134
- :dart: [`dart`](https://wiselabcmu.github.io/dart/)
127135

128136
---

grt/config/default.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@ defaults:
1313
hydra:
1414
run:
1515
dir: ${meta.results}/${meta.name}/${meta.version}
16+
callbacks:
17+
prevent_overwrite:
18+
_target_: nrdk.config.PreventHydraOverwrite
19+
1620

1721
meta:
18-
dataset: data/
19-
results: results/
22+
dataset: data
23+
results: results
2024
name: null
2125
version: null
2226
resume: null
27+
compile: false
2328

2429
size: {}
2530

@@ -57,7 +62,6 @@ datamodule:
5762

5863
lightningmodule:
5964
_target_: nrdk.framework.NRDKLightningModule
60-
compile: false
6165
vis_interval: 1000
6266
vis_samples: 16
6367
objective: ${objective}

grt/config/model/decoder/lidar3d.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ occ3d:
1212
norm_first: true
1313
bias: true
1414
d_model: ${size.d_model}
15-
num_layers: 4
15+
num_layers: ${size.dec_layers}
1616
shape: [1, 64, 128, 64]
1717
scale: [16.0, 16.0, 16.0, 16.0]
1818
w_min: 0.2

grt/config/model/decoder/semseg.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ semseg:
1212
norm_first: true
1313
bias: true
1414
d_model: ${size.d_model}
15-
num_layers: 4
15+
num_layers: ${size.dec_layers}
1616
shape: [1, 160, 160, 1]
1717
scale: [16.0, 16.0, 10.666, 16.0]
1818
w_min: 0.2

grt/config/objective/lidar2d.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ occupancy2d:
66
objective:
77
_target_: nrdk.objectives.Occupancy2D
88
range_weighted: True
9-
positive_weight: 64.0
9+
positive_weight: 1.0
1010
bce_weight: 0.9
1111
vis_config:
1212
cols: 8

grt/config/objective/lidar3d.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ occupancy3d:
66
objective:
77
_target_: nrdk.objectives.Occupancy3D
88
range_weighted: True
9-
positive_weight: 64.0
9+
positive_weight: 16.0
1010
mode: spherical
1111
vis_config:
1212
cols: 8

0 commit comments

Comments
 (0)