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
$87,666.00
0.28%
ETHETH
$2,936.38
0.32%
USDTUSDT
$0.999
0%
BNBBNB
$842.56
0.68%
XRPXRP
$1.87
1.49%
USDCUSDC
$1.00
0.02%
SOLSOL
$123.89
0.83%
TRXTRX
$0.284
1.57%
STETHSTETH
$2,935.82
0.34%
DOGEDOGE
$0.124
1.03%
FIGR_HELOCFIGR_HELOC
$1.02
0.35%
ADAADA
$0.371
5.14%
BCHBCH
$613.74
2.33%
WBTWBT
$56.22
0.11%
WSTETHWSTETH
$3,591.06
0.35%
WBTCWBTC
$87,466.00
0.38%
WBETHWBETH
$3,192.39
0.37%
USDSUSDS
$1.000
0.01%
WEETHWEETH
$3,185.08
0.35%
BSC-USDBSC-USD
$0.999
0%