Spaces:
Sleeping
Sleeping
Commit ·
45e8b30
1
Parent(s): 93b20f5
test: document pi05 GPU smoke check
Browse files- README.md +15 -0
- requirements.txt +1 -0
- tests/test_gpu_smoke.py +36 -0
- tests/test_space_config.py +1 -0
README.md
CHANGED
|
@@ -64,3 +64,18 @@ PYTHONPATH=openpi_runtime python app.py
|
|
| 64 |
```
|
| 65 |
|
| 66 |
The full OpenPI/JAX stack requires Python 3.11 and a compatible CUDA 12 GPU.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
```
|
| 65 |
|
| 66 |
The full OpenPI/JAX stack requires Python 3.11 and a compatible CUDA 12 GPU.
|
| 67 |
+
|
| 68 |
+
## Optional real-checkpoint smoke test
|
| 69 |
+
|
| 70 |
+
After installing the dependencies on a CUDA machine, opt in to the large model
|
| 71 |
+
download and end-to-end inference test with:
|
| 72 |
+
|
| 73 |
+
```bash
|
| 74 |
+
PI05_GPU_SMOKE=1 \
|
| 75 |
+
PI05_MODEL_ID=owner/model \
|
| 76 |
+
PI05_CHECKPOINT_PATH=checkpoints/30000 \
|
| 77 |
+
pytest tests/test_gpu_smoke.py -v
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
Do not put a Hugging Face access token in this command; use `HF_TOKEN` as a
|
| 81 |
+
local environment secret or a Hugging Face Space secret.
|
requirements.txt
CHANGED
|
@@ -28,3 +28,4 @@ transformers==4.53.2
|
|
| 28 |
rich>=14.0.0
|
| 29 |
polars>=1.30.0
|
| 30 |
pytest==8.3.5
|
|
|
|
|
|
| 28 |
rich>=14.0.0
|
| 29 |
polars>=1.30.0
|
| 30 |
pytest==8.3.5
|
| 31 |
+
lerobot @ git+https://github.com/huggingface/lerobot.git@0cf864870cf29f4738d3ade893e6fd13fbd7cdb5
|
tests/test_gpu_smoke.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import unittest
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class GPUCheckpointSmokeTest(unittest.TestCase):
|
| 6 |
+
@unittest.skipUnless(
|
| 7 |
+
os.getenv("PI05_GPU_SMOKE") == "1",
|
| 8 |
+
"set PI05_GPU_SMOKE=1 to run the real checkpoint test",
|
| 9 |
+
)
|
| 10 |
+
def test_real_checkpoint_prediction(self):
|
| 11 |
+
import numpy as np
|
| 12 |
+
from PIL import Image
|
| 13 |
+
|
| 14 |
+
from artifacts import resolve_checkpoint_path, resolve_model_id
|
| 15 |
+
from inference import run_prediction
|
| 16 |
+
from model_loader import MODEL_MANAGER
|
| 17 |
+
|
| 18 |
+
model_id = resolve_model_id()
|
| 19 |
+
checkpoint = resolve_checkpoint_path()
|
| 20 |
+
policy = MODEL_MANAGER.get(model_id, checkpoint)
|
| 21 |
+
image = Image.fromarray(np.zeros((224, 224, 3), dtype=np.uint8))
|
| 22 |
+
result = run_prediction(
|
| 23 |
+
policy,
|
| 24 |
+
image,
|
| 25 |
+
image,
|
| 26 |
+
"move safely",
|
| 27 |
+
[0.0] * 7,
|
| 28 |
+
0,
|
| 29 |
+
model_id,
|
| 30 |
+
checkpoint,
|
| 31 |
+
)
|
| 32 |
+
self.assertEqual(result.actions.shape, (10, 7))
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
if __name__ == "__main__":
|
| 36 |
+
unittest.main()
|
tests/test_space_config.py
CHANGED
|
@@ -11,6 +11,7 @@ def test_space_metadata_and_runtime_files():
|
|
| 11 |
assert "python_version: '3.11'" in readme
|
| 12 |
assert "app_file: app.py" in readme
|
| 13 |
assert "gradio==6.20.0" in requirements
|
|
|
|
| 14 |
assert (ROOT / "openpi_runtime/openpi/policies/ur_policy.py").is_file()
|
| 15 |
assert (ROOT / "openpi_runtime/openpi_client/base_policy.py").is_file()
|
| 16 |
|
|
|
|
| 11 |
assert "python_version: '3.11'" in readme
|
| 12 |
assert "app_file: app.py" in readme
|
| 13 |
assert "gradio==6.20.0" in requirements
|
| 14 |
+
assert "lerobot.git@0cf864870cf29f4738d3ade893e6fd13fbd7cdb5" in requirements
|
| 15 |
assert (ROOT / "openpi_runtime/openpi/policies/ur_policy.py").is_file()
|
| 16 |
assert (ROOT / "openpi_runtime/openpi_client/base_policy.py").is_file()
|
| 17 |
|