Skip to content

Add validated RTX SM89 support for GROOT N1.7 routing - #96

Merged
LiangSu8899 merged 2 commits into
flashrt-project:mainfrom
heiheiha798:fix/groot-n17-sm89-support-clean
Jun 20, 2026
Merged

LiangSu8899 merged 2 commits into
flashrt-project:mainfrom
heiheiha798:fix/groot-n17-sm89-support-clean

Conversation

@heiheiha798

@heiheiha798 heiheiha798 commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • enable validated groot_n17 RTX SM89 registration
  • add a dedicated SM89 FP8 frontend / pipeline path for GROOT N1.7
  • add the explicit SM89 FP16 reference frontend for use_fp16=True, use_fp8=False
  • align load_model() routing, public docs, and focused tests with the actual RTX SM120/SM89 behavior

What changed

Runtime:

  • flash_rt/frontends/torch/groot_n17_rtx_sm89.py
  • flash_rt/frontends/torch/groot_n17_rtx_sm89_fp16.py
  • flash_rt/models/groot_n17/pipeline_rtx_sm89.py

Routing:

  • flash_rt/api.py
  • flash_rt/hardware/__init__.py

Docs:

  • README.md
  • USAGE.md
  • docs/stable_api.md

Focused tests:

  • tests/test_load_model_use_fp8_kwarg.py

Behavior / routing contract

On RTX, load_model(config="groot_n17", framework="torch", hardware=...) now behaves as follows:

  • hardware="rtx_sm120"
    • keeps the historical shared RTX registration in _PIPELINE_MAP
    • load_model() refines the default route to the explicit FP8 production frontend
  • hardware="rtx_sm89"
    • resolves directly to the dedicated SM89 FP8 frontend
  • use_fp16=True, use_fp8=False
    • selects the explicit RTX reference frontend for the selected hardware

For groot_n17 on RTX/Thor, bare use_fp8=False is rejected. There is no separate BF16-only fallback; the non-quantized reference path is use_fp16=True, use_fp8=False.

Validation environment

  • GPU: NVIDIA GeForce RTX 4090 (sm89)
  • driver: 550.54.14
  • CUDA toolkit: 12.4 (nvcc 12.4.99)
  • env: /data/home/tianjianyang/miniconda3/envs/flashrt
  • PyTorch: 2.6.0+cu124
  • torchvision: 0.21.0+cu124
  • transformers: 4.57.3
  • build flags:
    • FA2_ARCH_NATIVE_ONLY=ON
    • FA2_DTYPES=fp16;bf16
    • FA2_HDIMS=96;128;256
  • checkpoint: /data/pretrained_models/GR00T-N1.7-3B
  • fixture: /data/home/tianjianyang/models/vla/gr00t_n17/fixtures/gr00t_n17_ref_oxe_droid_relative_eef_relative_joint_2v_traj1_step0_seed0.pt
  • aux: /data/home/tianjianyang/models/vla/gr00t_n17/fixtures/gr00t_n17_ref_oxe_droid_relative_eef_relative_joint_2v_traj1_step0_seed0_llm_aux.pt
  • env vars:
    • PYTHONPATH=/data/home/tianjianyang/code/Isaac-GR00T
    • GROOT_HF_LOCAL_FIRST=1
    • GROOT_PATCH_MISTRAL=1
    • PJRT_DEVICE=CUDA

Validation commands

Focused API / routing coverage:

/data/home/tianjianyang/miniconda3/envs/flashrt/bin/python -m pytest -q \
  tests/test_load_model_use_fp8_kwarg.py

Result:

  • 27 passed in 1.85s

Local runtime validation used during development:

PYTHONPATH=/data/home/tianjianyang/code/Isaac-GR00T \
GROOT_HF_LOCAL_FIRST=1 \
GROOT_PATCH_MISTRAL=1 \
PJRT_DEVICE=CUDA \
/data/home/tianjianyang/miniconda3/envs/flashrt/bin/python - <<'PY'
import time
import torch
from flash_rt.api import load_model

ckpt = "/data/pretrained_models/GR00T-N1.7-3B"
fixture = "/data/home/tianjianyang/models/vla/gr00t_n17/fixtures/gr00t_n17_ref_oxe_droid_relative_eef_relative_joint_2v_traj1_step0_seed0.pt"
aux_path = "/data/home/tianjianyang/models/vla/gr00t_n17/fixtures/gr00t_n17_ref_oxe_droid_relative_eef_relative_joint_2v_traj1_step0_seed0_llm_aux.pt"

blob = torch.load(fixture, map_location="cpu", weights_only=False)
aux = torch.load(aux_path, map_location="cpu", weights_only=False)
state = blob["state_normalized"]
noise = blob["initial_noise"]

for use_fp16, use_fp8 in ((False, True), (True, False)):
    model = load_model(
        ckpt,
        config="groot_n17",
        framework="torch",
        hardware="rtx_sm89",
        num_views=2,
        embodiment_tag="oxe_droid_relative_eef_relative_joint",
        use_fp16=use_fp16,
        use_fp8=use_fp8,
    )
    t0 = time.perf_counter()
    model.set_prompt(aux=aux, prompt="x")
    prompt_ms = (time.perf_counter() - t0) * 1000.0

    _ = model.infer(state, initial_noise=noise, use_dit_graph=True)
    torch.cuda.synchronize()
    starts = [torch.cuda.Event(enable_timing=True) for _ in range(20)]
    ends = [torch.cuda.Event(enable_timing=True) for _ in range(20)]
    for _ in range(5):
        _ = model.infer(state, initial_noise=noise, use_dit_graph=True)
    torch.cuda.synchronize()
    for i in range(20):
        starts[i].record()
        _ = model.infer(state, initial_noise=noise, use_dit_graph=True)
        ends[i].record()
    torch.cuda.synchronize()
    ms = [s.elapsed_time(e) for s, e in zip(starts, ends)]
    print({
        "use_fp16": use_fp16,
        "use_fp8": use_fp8,
        "set_prompt_ms": prompt_ms,
        "warm_infer_p50_ms": sorted(ms)[len(ms)//2],
        "warm_infer_mean_ms": sum(ms) / len(ms),
    })
PY

Kernel binding / CMake applicability

  • this PR does not change csrc/bindings.cpp, pybind ownership, CMake target ownership, or GPU_ARCH-gated source lists
  • the CONTRIBUTING.md cross-GPU_ARCH build/import validation requirement for binding/CMake changes is therefore not applicable to this PR

Precision results

  • FP8 (GrootN17TorchFrontendRtxSm89)
    • combined cosine: 0.999935
    • combined max abs diff: 0.036446
    • combined mean abs diff: 0.006404
  • FP16 (GrootN17TorchFrontendRtxSm89FP16)
    • combined cosine: 0.999974
    • combined max abs diff: 0.027434
    • combined mean abs diff: 0.003748

Note:

  • the gripper_position per-head cosine is noisy on this fixture because the reference norm is extremely small; the combined flattened cosine and absolute error are the more representative headline metrics

Latency results

These are warm graph-replay infer() measurements, not wall-clock quickstart numbers.

  • FP8 (GrootN17TorchFrontendRtxSm89)
    • set_prompt: 629.24 ms
    • warm infer(): p50 10.61 ms, mean 10.42 ms, p90 10.62 ms
  • FP16 (GrootN17TorchFrontendRtxSm89FP16)
    • set_prompt: 132.09 ms
    • warm infer(): p50 13.83 ms, mean 13.99 ms, p90 14.34 ms

Observed warm-infer() speedup on this machine:

  • 13.83 / 10.61 = 1.30x FP8 vs FP16

Limitations / unverified areas

  • this PR validates rtx_sm89 on a local RTX 4090 fixture path only; it does not claim cross-SM89-card latency parity
  • the validation is fixture-based, not LIBERO task-success based
  • the GROOT helper environment still depends on local Isaac-GR00T preprocessing and local-first HF resolution for the reference fixture workflow
  • current SM89 FP8 performance is functionally good but not fused-epilogue parity with the validated SM120 route
  • attempted cuBLASLt FP8 nt fused epilogues were not viable on this local SM89 + CUDA/cuBLASLt stack (cublasLtMatmulAlgoGetHeuristic(...), code=15)
  • this PR does not add broader regression fixtures such as multi-aux calibration coverage
  • repo-side automated coverage is focused on routing/layout/helper semantics; this PR does not add a real-checkpoint smoke test in CI
  • the SM89 full-FP16 reference frontend is hardware-specific at the frontend level, but still reuses the shared RTX pipeline_rtx_fp16 DiT compute path; this PR does not further split that shared FP16 path
  • groot_n17 on rtx_sm120 still keeps the historical shared RTX registration and relies on load_model() to refine the default route to the explicit FP8 production frontend

@heiheiha798
heiheiha798 requested a review from LiangSu8899 as a code owner June 20, 2026 06:39
Copilot AI review requested due to automatic review settings June 20, 2026 06:39

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 commented Jun 20, 2026 •

Copy link
Copy Markdown
Member

Thanks for doing this and documenting this limitation! I think the code=15 here is very likely a cuBLASLt stack/version capability issue rather than a model-level correctness issue.

I just reproduced a very similar case on our SM120 path:

  • Same RTX 5090 host and same FlashRT shape:
    • M=512, N=3456, K=1152
    • GemmRunner.fp8_nn_dev
  • Native host:
    • PyTorch 2.9.1+cu128
    • CUDA toolkit 13.0
    • cublasLtGetVersion() = 130002
    • libcublasLt.so.13.0.2.14
    • result: cublasLtMatmulAlgoGetHeuristic(...), code=15
  • pi0-stablehlo-test container:
    • PyTorch 2.9.0a0...nv25.10
    • CUDA toolkit 13.0
    • cublasLtGetVersion() = 130100
    • libcublasLt.so.13.1.0.3
    • result: the same shape succeeds

Also, in the same native environment where fp8_nn_dev failed, fp8_nt_dev succeeded. So the failure is descriptor/layout/epilogue/version-specific, not a generic FP8 failure.

For the SM89 fused-epilogue failure in this PR, I would suggest checking and recording the exact cuBLASLt runtime version, not just the CUDA toolkit version:

import ctypes, ctypes.util

lib = ctypes.CDLL(ctypes.util.find_library("cublasLt"))
lib.cublasLtGetVersion.restype = ctypes.c_size_t
print("cublasLt version:", lib.cublasLtGetVersion())

If the current RTX 4090 stack is CUDA 12.4 / PyTorch 2.6 / an older cuBLASLt, it is worth retrying the same minimal fused-epilogue descriptor on a newer NGC/PyTorch container, ideally the 25.10-family stack or anything with newer cuBLASLt. Based on the SM120 result above, there is a good chance the code=15 is resolved by the cuBLASLt update rather than by changing FlashRT code.

Useful references:
NVIDIA cuBLAS documentation: CUBLAS_STATUS_NOT_SUPPORTED means the requested functionality/parameter combination is not supported:
https://docs.nvidia.com/cuda/cublas/
NVIDIA cuBLAS 12.0 blog notes that FP8 fused epilogues are library/hardware feature-dependent:
https://developer.nvidia.com/blog/new-cublas-12-0-features-and-matrix-multiplication-performance-on-nvidia-hopper-gpus/
NVIDIA CUDALibrarySamples issue showing an FP8 + bias cuBLASLt heuristic status 15 that was fixed in a later cuBLAS update:
NVIDIA/CUDALibrarySamples#187

@heiheiha798

Copy link
Copy Markdown
Contributor Author

Thanks, that makes sense. I checked the local RTX 4090 validation stack and the cuBLASLt runtime is:

  • ctypes.util.find_library("cublasLt") -> libcublasLt.so.12
  • cublasLtGetVersion() = 120402

I agree the code=15 result should be framed as a stack/version-specific cuBLASLt limitation rather than a model-level or SM89-level correctness issue. This validation server is an older CentOS setup with a manually maintained runtime stack, so testing a newer NGC/PyTorch/cuBLASLt stack is not straightforward from this machine.

For this PR I will keep the known-good SM89 path (fp8_nt_dev + explicit cast/bias/GELU) and report the exact local cuBLASLt runtime version and limitation. A reasonable follow-up would be to retry the same minimal fused-epilogue descriptor on a newer cuBLASLt stack before deciding whether a custom/CUTLASS/Triton fused path is needed.

@LiangSu8899
LiangSu8899 merged commit 47a5153 into flashrt-project:main Jun 20, 2026
@heiheiha798
heiheiha798 deleted the fix/groot-n17-sm89-support-clean branch June 28, 2026 12:38
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