XiangpengYang commited on
Commit
f2f1146
·
1 Parent(s): f5992a2

docs: design selectable UR policy config

Browse files
docs/superpowers/specs/2026-07-23-selectable-ur-policy-config-design.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Selectable UR Policy Configuration Design
2
+
3
+ ## Goal
4
+
5
+ Allow the Gradio Space to load either the state-conditioned or no-state π₀.₅
6
+ UR configuration without editing deployment code.
7
+
8
+ ## Interface
9
+
10
+ Add a `Policy config` dropdown with exactly two accepted values:
11
+
12
+ - `pi05_ur_demo_no_state` (default);
13
+ - `pi05_ur_demo_state`.
14
+
15
+ The no-state option is the default because the currently deployed checkpoint
16
+ repository is named `pi0.5-nostate`. The seven state controls remain visible so
17
+ users can switch configurations without rebuilding the page. The page explains
18
+ that these controls do not provide discrete state conditioning in no-state mode.
19
+
20
+ ## Loading and Caching
21
+
22
+ Pass the selected configuration from `predict_ui` to `ModelManager.get`. Validate
23
+ it against an explicit allowlist before downloading or loading a model. Extend
24
+ the cache key from `(model_id, checkpoint_path)` to
25
+ `(model_id, checkpoint_path, config_name)` so switching configurations always
26
+ rebuilds the OpenPI Policy.
27
+
28
+ The default loader calls `openpi_config.get_config(config_name)`. Its successful
29
+ load status reports both `config_name` and `config.model.discrete_state_input`.
30
+ Repository names and checkpoint paths never determine the configuration
31
+ implicitly.
32
+
33
+ ## Inference and Errors
34
+
35
+ Both configurations keep the existing UR image, prompt, state, action transform,
36
+ normalization, and output shape contracts. The OpenPI model transforms decide
37
+ whether state is used as discrete conditioning. Unsupported configuration names
38
+ fail before model download with an actionable validation error.
39
+
40
+ ## Tests
41
+
42
+ CPU tests verify the dropdown default and choices, config propagation through
43
+ the UI, allowlist rejection, cache separation by configuration, and loader use
44
+ of the selected config. Existing inference, artifact, and Space tests remain
45
+ unchanged.