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
$67,936.00
0.11%
ETHETH
$1,984.02
0.25%
USDTUSDT
$1.000
0.01%
XRPXRP
$1.39
0.11%
BNBBNB
$612.20
1.13%
USDCUSDC
$1.000
0.01%
SOLSOL
$81.29
0.85%
TRXTRX
$0.278
0.83%
DOGEDOGE
$0.0938
3%
FIGR_HELOCFIGR_HELOC
$1.05
1.23%
WBTWBT
$51.08
0.02%
BCHBCH
$514.15
1.25%
ADAADA
$0.265
2.26%
USDSUSDS
$0.999
0.05%
LEOLEO
$8.48
1%
HYPEHYPE
$31.03
6.77%
CCCC
$0.169
2.8%
USDEUSDE
$0.998
0.08%
XMRXMR
$338.16
1.15%
LINKLINK
$8.50
0.85%