Skip to content

build!: impose more strict constraint on rerun-sdk#1404

Closed
cverrier wants to merge 1 commit intohuggingface:mainfrom
cverrier:build/impose-stricter-constraint-on-rerun-sdk
Closed

build!: impose more strict constraint on rerun-sdk#1404
cverrier wants to merge 1 commit intohuggingface:mainfrom
cverrier:build/impose-stricter-constraint-on-rerun-sdk

Conversation

@cverrier
Copy link
Contributor

What this does

Originally, the constraint rerun-sdk>=0.21.0 was imposed. However, in rerun-sdk==0.23.0, Scalar was deprecated in favor of the newly introduced Scalars. For relatively new users of LeRobot that install a new virtual environment, rerun-sdk>=0.23.0 would be installed, hence raising multiple DeprecationWarnings when running robot experiments, which is annoying and clutters the logs. For example, running

HF_USER=$(huggingface-cli whoami | head -n 1)
python -m lerobot.record \
    --robot.type=so101_follower \
    --robot.port=<FOLLOWER_PORT> \
    --robot.id=follower \
    --teleop.type=so101_leader \
    --teleop.port=<LEADER_PORT> \
    --teleop.id=leader \
    --display_data=true \
    --dataset.repo_id=${HF_USER}/record-a-dummy-task \
    --dataset.num_episodes=1 \
    --dataset.push_to_hub=False \
    --dataset.single_task="A dummy task"

would lead to something similar to

/Users/clementverrier/repos/lerobot/lerobot/record.py:227: DeprecationWarning: since 0.23.0: Use `Scalars` instead.
  rr.log(f"observation.{obs}", rr.Scalar(val))
/Users/clementverrier/repos/lerobot/lerobot/record.py:232: DeprecationWarning: since 0.23.0: Use `Scalars` instead.
  rr.log(f"action.{act}", rr.Scalar(val))

for each recorded episode.

Therefore, replace Scalar with Scalars and update the associated dependency constraint accordingly (Scalars is only available in rerun-sdk>=0.23.0).

BREAKING CHANGE: requires rerun-sdk>=0.23.0 and replaces Scalar with Scalars, which is only available in rerun-sdk>=0.23.0. Users must upgrade their rerun-sdk version.

How it was tested

Run the same command as before:

```bash
HF_USER=$(huggingface-cli whoami | head -n 1)
python -m lerobot.record \
    --robot.type=so101_follower \
    --robot.port=<FOLLOWER_PORT> \
    --robot.id=follower \
    --teleop.type=so101_leader \
    --teleop.port=<LEADER_PORT> \
    --teleop.id=leader \
    --display_data=true \
    --dataset.repo_id=${HF_USER}/record-a-dummy-task \
    --dataset.num_episodes=1 \
    --dataset.push_to_hub=False \
    --dataset.single_task="A dummy task"

No DeprecationWarnings should be thrown anymore.

How to checkout & try? (for the reviewer)

See explanations above.

Since this dependency update introduces a breaking change (for any user that has rerun-sdk<0.23.0 in his environment`), I am not sure you want to merge this pull request directly. But I found it nice to have it as reference for future dependency update. @CarolinePascal could you look at it?

Originally, the constraint `rerun-sdk>=0.21.0` was imposed. However, in
`rerun-sdk==0.23.0`, `Scalar` was deprecated in favor of the newly
introduced `Scalars`. For relatively new users of LeRobot that install a
new virtual environment, `rerun-sdk>=0.23.0` would be installed, hence
raising multiple `DeprecationWarning`s when running robot experiments,
which is annoying and clutters the logs.

Therefore, replace `Scalar` with `Scalars` and update the associated
dependency constraint accordingly.

BREAKING CHANGE: requires rerun-sdk>=0.23.0 and replaces `Scalar` with
`Scalars`, which is only available in rerun-sdk>=0.23.0. Users must
upgrade their rerun-sdk version.
@cverrier cverrier marked this pull request as ready for review June 29, 2025 13:17
Copilot AI review requested due to automatic review settings June 29, 2025 13:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Updates the rerun-sdk requirement to v0.23.0+ and replaces deprecated Scalar calls with the new Scalars API to eliminate deprecation warnings.

  • Bump rerun-sdk constraint in pyproject.toml
  • Replace rr.Scalar with rr.Scalars in float logging within teleoperate and record loops

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pyproject.toml Bumped rerun-sdk version requirement to >=0.23.0
lerobot/teleoperate.py Swapped rr.Scalar for rr.Scalars when logging floats
lerobot/record.py Swapped rr.Scalar for rr.Scalars when logging floats
Comments suppressed due to low confidence (2)

lerobot/teleoperate.py:87

  • Consider adding a test to verify that float observations and actions are logged correctly using rr.Scalars, ensuring no regressions and that deprecation warnings are gone.
                    rr.log(f"observation_{obs}", rr.Scalars(val))

lerobot/record.py:227

  • Add a unit or integration test for the record_loop to ensure rr.Scalars is used for floats and no deprecation warnings are emitted.
                    rr.log(f"observation.{obs}", rr.Scalars(val))

@CarolinePascal
Copy link
Collaborator

Hi @cverrier,

Thanks for the PR ! Is rr.Scalar the only deprecation warning/deprecated use we should worry about ? I'm wondering if we should think ahead and start modifying our rerun usage to already match newly introduced usages.

If that is all, I'll give it a try on my side and proceed to merge :)

Best,

Caroline.

@cverrier
Copy link
Contributor Author

cverrier commented Jul 2, 2025

Is rr.Scalar the only deprecation warning/deprecated use we should worry about ? I'm wondering if we should think ahead and start modifying our rerun usage to already match newly introduced usages.

I don't know, I just saw the warnings that I mentioned earlier and decided to fix them, I didn't try to modify anything else 😄

@ben-z
Copy link
Contributor

ben-z commented Jul 3, 2025

Garbage collection (and rr.log(..., static=True)) is broken in rerun 0.23. I was wondering why rerun always uses over 10GB of RAM in my setup.

Comparison with LEROBOT_RERUN_MEMORY_LIMIT=100MiB:

export RUST_LOG=debug LEROBOT_RERUN_MEMORY_LIMIT=100MiB; python -m lerobot.teleoperate --robot.type=so101_follower --robot.port=$F1_PORT --robot.id=f1 --robot.cameras="${CAMERA_CONFIG}" --teleop.type=so101_leader --teleop.port=$L1_PORT --teleop.id=l1 --display_data=true

v0.22.1
image

v0.23.0
image

I recommend always using a max version in requirements.txt. I usually set it to the next minor version, e.g.

rerun-sdk>=0.22.0,<0.23.0

Made a PR for pinning the ceiling versions: #1435

@CarolinePascal CarolinePascal added visualization Issues about visual output, graphs, or data visualization enhancement Suggestions for new features or improvements labels Jul 9, 2025
@CarolinePascal
Copy link
Collaborator

CarolinePascal commented Jul 25, 2025

Hi @cverrier @ben-z !

Recent changes on pyproject.toml enforced <0.23.0 on rerun 👍 We will try to bump directly to version 0.24.0 which will require extra work to support the new URDF loader. Feel free to keep discussing the topic on #1375/#1544 ! In the meantime, I'll close this PR.

Best,

Caroline.

@cverrier cverrier deleted the build/impose-stricter-constraint-on-rerun-sdk branch July 25, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Suggestions for new features or improvements visualization Issues about visual output, graphs, or data visualization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants