Skip to content

Conversation

@pranavsaroha
Copy link
Contributor

Summary

Fixes InductorError: NotImplementedError: welford_combine when running PI05 policy inference on Apple Silicon (MPS device). This error occurs because torch.compile on MPS does not support the Welford reduction operation used in layer normalization.

Problem

When running PI05 policy with compile_model=True on Apple Silicon Macs:

torch._inductor.exc.InductorError: NotImplementedError: welford_combine

The error occurs during model compilation because the MPS backend doesn't implement the welford_combine reduction used for computing mean and variance in layer normalization operations.

Solution

Added a device check before applying torch.compile:

  • If device is mps, skip compilation and log a warning
  • Otherwise, proceed with compilation as normal

Testing

Tested successfully with:

  • MacBook Pro (M-series chip)
  • compile_model=True in config
  • SO100 Follower robot with dual camera setup

Related

This is a known limitation of PyTorch's MPS backend: pytorch/pytorch#150121

Fixes InductorError when running PI05 policy on Apple Silicon (MPS).
torch.compile on MPS does not support the welford_combine reduction
operation used in layer normalization.

Changes:
- Check if device is MPS before applying torch.compile
- Log a warning when compilation is skipped on MPS
- Allow model to run without compilation (slower but functional)

Error fixed:
  torch._inductor.exc.InductorError: NotImplementedError: welford_combine

This enables PI05 policy inference on Apple Silicon Macs until full
MPS support is added to torch.compile.

Tested with:
- MacBook Pro with Apple Silicon (MPS device)
- PI05 policy with compile_model=True
- SO100 Follower robot with dual camera setup
@github-actions github-actions bot added the policies Items related to robot policies label Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

policies Items related to robot policies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant