mirror of
https://github.com/karpathy/nanochat.git
synced 2026-01-02 09:42:31 +00:00
cleanup
This commit is contained in:
parent
e0e168dacd
commit
e243767cc3
|
|
@ -112,8 +112,7 @@ with torch.device("meta"):
|
||||||
model.to_empty(device=device)
|
model.to_empty(device=device)
|
||||||
model.init_weights()
|
model.init_weights()
|
||||||
orig_model = model # original, uncompiled model, for saving raw model state_dict
|
orig_model = model # original, uncompiled model, for saving raw model state_dict
|
||||||
eval_model = model
|
eval_model = torch.compile(model, fullgraph=True, dynamic=True) # eval model compiled for dynamic shapes
|
||||||
eval_model = torch.compile(eval_model, fullgraph=True, dynamic=True)
|
|
||||||
model = torch.compile(model, fullgraph=True, dynamic=False) # TODO: dynamic True/False think through
|
model = torch.compile(model, fullgraph=True, dynamic=False) # TODO: dynamic True/False think through
|
||||||
num_params = sum(p.numel() for p in model.parameters())
|
num_params = sum(p.numel() for p in model.parameters())
|
||||||
print0(f"Number of parameters: {num_params:,}")
|
print0(f"Number of parameters: {num_params:,}")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user