Skip to content

Document Pi0.5 JAX FP4 Thor validation - #100

Merged
LiangSu8899 merged 2 commits into
flashrt-project:mainfrom
heiheiha798:docs/pi05-jax-fp4-validation
Jun 21, 2026
Merged

LiangSu8899 merged 2 commits into
flashrt-project:mainfrom
heiheiha798:docs/pi05-jax-fp4-validation

Conversation

@heiheiha798

Copy link
Copy Markdown
Contributor

Summary

  • Align README, USAGE, stable API, and load_model() docs with the existing Pi0.5 JAX NVFP4 Thor route.
  • Remove stale wording that described JAX use_fp4=True as not wired up / FP8-only.
  • Clarify that the torch FP4 path uses safetensors checkpoints and the JAX FP4 path uses Orbax checkpoints.
  • Add a CPU-only route regression proving load_model(config="pi05", framework="jax", hardware="thor", use_fp4=True) selects Pi05JaxFrontendThorFP4 and forwards the production preset kwargs.

Dependency

This docs / route-test PR depends on the Orbax StepMetadata loader fix in #99 for full Thor JAX Orbax checkpoint validation in the current CUDA13-era JAX / Orbax stack.

This PR itself does not include the loader changes from #99.

Validation

Local static check:

python -m py_compile flash_rt/api.py tests/test_load_model_use_fp8_kwarg.py
-> passed

Local route regression:

/data/home/tianjianyang/miniconda3/envs/flashrt/bin/python -m pytest tests/test_load_model_use_fp8_kwarg.py -q
-> 29 passed in 1.92s

Whitespace:

git diff --check
-> passed

Thor validation performed during development with #99 applied:

GPU: NVIDIA Thor, compute capability (11, 0)
Python: 3.12.0
PyTorch: 2.10.0
CUDA runtime: 13.0
JAX stack: jax==0.9.2, jaxlib==0.9.2,
           jax-cuda13-pjrt==0.9.2, jax-cuda13-plugin==0.9.2
NumPy: 2.2.6
XLA_FLAGS=--xla_gpu_autotune_level=0

Same-origin PyTorch reference:

/tmp/pytorch_reference.npz
sha256=b21609fda4e0ef326a2c72a75c12e1b3db45611820f3ec4a72c7816f5036f6e7

The reference was generated from the same pi05_libero_jax Orbax checkpoint used on Thor via the upstream OpenPI conversion script and PI0Pytorch.sample_actions; it is not the separate HF / LeRobot safetensors checkpoint.

Thor replay-latency / precision checks:

python tests/bench_pi05_thor_views.py --frontends jax_fp8 --views 3
-> calibrate_ms=479.4, p50_ms=55.03, p95_ms=55.23,
   cos_vs_fp32_ref=0.999358, maxdiff_vs_ref=0.0638

python tests/bench_pi05_thor_views.py --frontends jax_fp4 --views 3
-> calibrate_ms=36150.3, p50_ms=50.30, p95_ms=56.58,
   cos_vs_fp32_ref=0.998351, maxdiff_vs_ref=0.0994

Limits / Notes

  • No kernel, CMake, pybind, Orbax loader, or runtime kernel code changes are included.
  • This does not add FP4 support for Pi0, GROOT, or Pi0-FAST.
  • The Thor numbers are correctness / availability evidence for the JAX FP4 path, not a broad performance claim across every view count or host.
  • Broader Thor calibration matrix tests such as tests/test_thor_calibrate_matrix.py --models pi05_jax_fp4 --n 8 were not rerun for this docs PR.

Align README, USAGE, stable API, and load_model docstring with the existing Pi0.5 JAX NVFP4 Thor route. The docs now distinguish torch safetensors from JAX Orbax checkpoints and keep the Thor benchmark numbers scoped to correctness and availability evidence instead of a broad performance claim.

Add a CPU-only load_model routing regression that injects fake FP4/JAX frontend modules and verifies config='pi05', framework='jax', hardware='thor', use_fp4=True selects Pi05JaxFrontendThorFP4 with the production preset kwargs. This PR does not include Orbax loader, kernel, CMake, pybind, or runtime kernel changes.
@heiheiha798
heiheiha798 requested a review from LiangSu8899 as a code owner June 21, 2026 14:27
Copilot AI review requested due to automatic review settings June 21, 2026 14:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@LiangSu8899
LiangSu8899 merged commit c6e53b3 into flashrt-project:main Jun 21, 2026
@heiheiha798
heiheiha798 deleted the docs/pi05-jax-fp4-validation branch June 21, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants