Blog

Sep 09, 2025

DTensor 101: Mesh, Layout, and SPMD in TensorFlow

DTensor adds a global, sharded-tensor model to TensorFlow. You define a device Mesh and a per-axis Layout; DTensor expands your code via SPMD, inserting collectives so ops like tf.matmul run across CPUs/GPUs/TPUs—or even multi-client setups—with the same Python. You can replicate or shard tensors, pack/unpack components, request sharded outputs with dtensor.call_with_layout, and use dtensor.DVariable (fixed layout) instead of tf.Variable. The notebook walks through creating meshes, applying layouts, matmul sharding strategies, generating DTensor outputs, and variable semantics—setting you up for DTensor-based distributed training.

Source: HackerNoon →


Share

BTCBTC
$110,893.00
2.28%
ETHETH
$3,979.63
3.76%
USDTUSDT
$1.00
0.02%
BNBBNB
$1,160.73
4.79%
XRPXRP
$2.41
3.98%
SOLSOL
$193.97
4.44%
USDCUSDC
$1.000
0%
STETHSTETH
$3,977.34
3.8%
TRXTRX
$0.319
0.72%
DOGEDOGE
$0.196
4.32%
ADAADA
$0.667
4.63%
WSTETHWSTETH
$4,836.92
3.85%
WBTCWBTC
$110,801.00
2.18%
WBETHWBETH
$4,286.10
3.88%
FIGR_HELOCFIGR_HELOC
$1.02
3.22%
LINKLINK
$18.01
5.77%
USDEUSDE
$1.00
0.02%
WEETHWEETH
$4,292.00
3.86%
BCHBCH
$522.41
3.29%
XLMXLM
$0.324
4.12%