MCPcopy Index your code
hub / github.com/pytorch/examples / inspect_model

Function inspect_model

distributed/FSDP2/utils.py:7–17  ·  view source on GitHub ↗
(model: FSDPModule)

Source from the content-addressed store, hash-verified

5
6
7def inspect_model(model: FSDPModule):
8 assert isinstance(model, Transformer)
9 assert isinstance(model, FSDPModule)
10
11 if torch.distributed.get_rank() == 0:
12 print(model)
13
14 for param in model.parameters():
15 assert param.placements == (Shard(0),)
16 assert param.dtype == torch.float32
17 # print(param.get_local_tensor())
18
19
20def inspect_mixed_precision(model: FSDPModule):

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected