pytorch/xla

xs.make_mesh

Open

#8,838 创建于 2025年3月14日

在 GitHub 查看
 (1 评论) (0 反应) (1 负责人)C++ (575 fork)github user discovery
enhancementgood first issue

仓库指标

Star
 (2,786 star)
PR 合并指标
 (PR 指标待抓取)

描述

🚀 Feature

We should provide a xs.make_mesh method similar to JAX: https://docs.jax.dev/en/latest/_autosummary/jax.make_mesh.html

Motivation

The ordering of devices affects the performance of collective operations:

  • Weights are sharded differently and the layout of tensors after an all-gather is different.
  • The performance of a collective op itself depends on what network connections it uses.

Pitch

The xs.make_mesh method should attempt to create a reasonably optimized device ordering given a mesh shape referencing how JAX does it.

We could also deviate from JAX and add additional options that fit our own needs.

cc @yaochengji

贡献者指南