Skip to content

Commit

Permalink
Port and update changes as needed from https://github.com/daniel-p-go…
Browse files Browse the repository at this point in the history
…nzalez/hlb-gpt, as mentioned and discussed in tysam-code#4.
  • Loading branch information
tysam-code committed Mar 19, 2023
1 parent 1c3e0fb commit fe47f53
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
using_pytorch_2 = (int(torch.__version__.split('.')[0]) >= 2)
if not using_pytorch_2:
print("Info: Pytorch 2.0 isn't currently installed. Falling back to slower Pytorch 1.x pathway.")
torch_compile = lambda func: func
else:
torch_compile = torch.compile

## <-- teaching comments
# <-- functional comments
Expand Down Expand Up @@ -331,7 +328,6 @@ def init_split_parameter_dictionaries(net):

return params_non_decay, params_decay

@torch_compile
def get_grad_norm(net):
# Gets the entire grad norm of the network.
grad_norm = torch.tensor(0., device=hyp['misc']['device'])
Expand Down

0 comments on commit fe47f53

Please sign in to comment.