Skip to content

Commit f689b12

Browse files
committed
Publish camera inference in dataset layout
1 parent 3a130c5 commit f689b12

22 files changed

Lines changed: 1547 additions & 99 deletions

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ torchrun --standalone --nproc-per-node=1 -m solarwm infer \
161161
--set checkpoint.path=/path/to/SolarWM-models/SolarWM-5B-sgf-stage2-81f \
162162
--set data.index_root=/path/to/SolarWM-Data/releases-v1 \
163163
--set data.transport.root=/path/to/SolarWM-Data/releases-v1 \
164+
--set inference.run_id=sekai-game-fix-release \
164165
--set runtime.output_dir=/path/to/output
165166

166167
# Preencode raw-WDS for the Wan2.2-5B 153f recipe.

configs/examples/wan22_ti2v_5b/infer_stage2_sgf_camera_length.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ checkpoint:
9696
inference:
9797
source: validation
9898
length: camera
99+
output_layout: dataset_triplet_v1
100+
run_id: wan22-ti2v-5b-stage2-sgf-camera-length-inference
99101
runtime:
100102
output_dir: /path/to/outputs/wan22-ti2v-5b-stage2-sgf-camera-length-inference
101103
compile_flex: false

docs/backends/wan22-ti2v-5b.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,50 @@ torchrun --standalone --nproc-per-node=1 -m solarwm infer \
144144
--set checkpoint.path="$SOLAR_MODEL_ROOT/SolarWM-5B-sgf-stage2-81f" \
145145
--set data.index_root="$SOLAR_DATA_ROOT" \
146146
--set data.transport.root="$SOLAR_DATA_ROOT" \
147+
--set inference.run_id=sekai-game-fix-release \
147148
--set runtime.output_dir="$SOLAR_OUTPUT_ROOT/wan5-stage2-sgf-infer"
148149
```
149150

150151
The Stage2 command loads the checkpoint directory as one model, resolves its
151152
weight role from `release-manifest.json` (`ema` for the published checkpoint),
152153
and uses the longest camera-backed horizon available for each selected test
153154
sample. The horizon is rounded down to complete three-latent chunks; at the
154-
configured 16 fps, a 960-frame camera track produces 240 latents and 957
155-
decoded frames. Outputs longer than 60 latents are VAE-decoded as consecutive
156-
60-latent tiles with one continuous temporal cache.
157-
Override `data.test_index` to select a different raw-WDS test index. Outputs
158-
are written below `runtime.output_dir/generation`.
155+
configured 16 fps, a 960-frame camera track produces 240 latents and 957 model
156+
frames. Publication repeats the final generated frame three times so the
157+
generated and comparison MP4s, and their camera trajectory, all contain 960
158+
frames. Outputs longer than 60 latents are VAE-decoded as consecutive 60-latent
159+
tiles with one continuous temporal cache.
160+
161+
Camera-length inference defaults to `inference.output_layout=dataset_triplet_v1`.
162+
`runtime.output_dir` is the shared publication root, while `inference.run_id`
163+
selects a create-only provenance transaction beneath `runs/`. Every selected
164+
index row must provide `clip_id`. The physical dataset is `physical_generation`
165+
when that field is non-empty, and otherwise `dataset`; outputs are:
166+
167+
```text
168+
runtime.output_dir/
169+
generate/<physical_dataset>/<clip_id>.mp4
170+
compare/<physical_dataset>/<clip_id>.mp4
171+
camera/<physical_dataset>/<clip_id>.npy
172+
runs/<run_id>/
173+
generation/...
174+
publication/...
175+
resolved-config.json
176+
launch-manifest.json
177+
run-result.json
178+
COMPLETE.json
179+
```
180+
181+
The camera file is the source authoritative absolute C2W trajectory selected
182+
at the published frame timestamps and cast directly to contiguous float64 for
183+
compatibility. It is never the rebased or translation-transformed model camera.
184+
All public artifacts are create-only, and consumers must require the run-level
185+
`COMPLETE.json`. A run ID cannot be reused. The dataset-triplet layout currently
186+
requires a single shared-filesystem node; multi-node node-local output is
187+
rejected. Set `inference.output_layout=transaction_v1` only when the legacy
188+
private `runtime.output_dir/generation` transaction is explicitly desired.
189+
190+
Override `data.test_index` to select a different raw-WDS test index.
159191

160192
The other released checkpoints use the same command with the config, GPU
161193
count, checkpoint directory, and output directory shown above. The fixed

src/solarwm/backends/wan22/generation.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
from typing import Any
99

1010
from solarwm.errors import BackendContractError
11-
from solarwm.runtime.output_layout import validation_pass_component
11+
from solarwm.runtime.output_layout import (
12+
camera_inference_output_layout,
13+
validation_pass_component,
14+
)
1215

1316

1417
@dataclass(frozen=True)
@@ -83,6 +86,8 @@ def resolve_generation_plan(config: Mapping[str, Any]) -> GenerationPlan:
8386
raise BackendContractError(
8487
"camera-length inference is supported only for standalone Stage2 inference"
8588
)
89+
if camera_length:
90+
camera_inference_output_layout(config)
8691
if action == "infer" and str(inference.get("source", "")) != "validation":
8792
raise BackendContractError("inference.source must be validation")
8893
raw_passes = validation.get("passes", [])

src/solarwm/backends/wan22/runtime/data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ def build_camera_tokens(
248248
payload,
249249
_camera_array_key(manifest, configured_array_key),
250250
)
251+
matrices = np.asarray(matrices, dtype=np.float32)
251252
declared_shape = tuple(int(value) for value in manifest["camera"]["shape"])
252253
if matrices.shape != declared_shape:
253254
raise DataContractError(

0 commit comments

Comments
 (0)