| 7 | namespace mx = mlx::core; |
| 8 | |
| 9 | int main() { |
| 10 | if (!mx::distributed::is_available()) { |
| 11 | std::cout << "No communication backend found" << std::endl; |
| 12 | return 1; |
| 13 | } |
| 14 | |
| 15 | auto global_group = mx::distributed::init(); |
| 16 | std::cout << global_group.rank() << " / " << global_group.size() << std::endl; |
| 17 | |
| 18 | mx::array x = mx::ones({10}); |
| 19 | mx::array out = mx::distributed::all_sum(x, global_group); |
| 20 | |
| 21 | std::cout << out << std::endl; |
| 22 | } |