Skip to content

Conversation

richiejp
Copy link

@richiejp richiejp commented Jun 12, 2025

What this does

While testinging on Intel (XPU) I found that:

  • 2_evaluate_pretrained_policy.py failed with an error claiming tensors were on CPU as well as XPU. Moving the policy to the specified device (xpu) fixes the issue and matches the behaviour in the training script.
  • train.py failed to run just because some utility functions failed to recognize XPU as a valid device type, so I added it.

Also this adds a Dockerfile file for XPU based on Intel's PyTorch Dockerfile.

How it was tested

I ran the policy training and evaluation for pusht on an Intel Arc a770 using the provided Dockerfile.

How to checkout & try? (for the reviewer)

Run the examples/2_evaluate_pretrained_policy.py script or the training script.

To test on Intel the following Docker commands could be used:

docker build -t lerobot:xpu -f docker/lerobot-xpu/Dockerfile .
docker run -it --rm \
      --device /dev/dri \
      -v /dev/dri/by-path:/dev/dri/by-path \
      --ipc=host \
      -v ~/.cache/huggingface:/root/.cache/huggingface \
      -v ~/python/lerobot/outputs:/lerobot/outputs \
      lerobot:xpu python lerobot/scripts/train.py \
      --dataset.repo_id=lerobot/pusht \
      --policy.type=diffusion \
      --policy.device=xpu \
      --env.type=pusht \
      --log_freq=100 \
      --save_freq=1000 \
      --steps=10000

@richiejp richiejp changed the title Ensure tensors are on the same device in 2_evaluate_pretrained_policy.py Support Intel XPU Jun 16, 2025
@richiejp
Copy link
Author

While trying to run SmolVLA I found XPU does not support f64, so allowed it to fallback to f32 the same as mps.

@CarolinePascal CarolinePascal added enhancement Suggestions for new features or improvements policies Items related to robot policies labels Jul 25, 2025
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 policies Items related to robot policies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants