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
$70,808.00
0.92%
ETHETH
$2,090.80
1.2%
USDTUSDT
$1.00
0.01%
BNBBNB
$656.08
0.75%
XRPXRP
$1.40
0.61%
USDCUSDC
$1.000
0%
SOLSOL
$88.16
2.05%
TRXTRX
$0.293
1.1%
FIGR_HELOCFIGR_HELOC
$1.02
1.4%
DOGEDOGE
$0.0956
0.72%
WBTWBT
$55.48
1.07%
USDSUSDS
$1.000
0.02%
ADAADA
$0.265
2.39%
BCHBCH
$459.58
0.75%
HYPEHYPE
$36.69
3.68%
LEOLEO
$9.07
0.01%
XMRXMR
$361.90
0.61%
LINKLINK
$9.08
1.94%
USDEUSDE
$1.00
0.02%
CCCC
$0.155
4.33%