Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Grokking demo currently broken in Colab #543

Open
1 task done
bryce13950 opened this issue Apr 16, 2024 · 1 comment
Open
1 task done

[Bug Report] Grokking demo currently broken in Colab #543

bryce13950 opened this issue Apr 16, 2024 · 1 comment
Labels
bug Something isn't working demo Creating a demo or tutorial

Comments

@bryce13950
Copy link
Collaborator

The Grokking demo is currently not executing properly in Colab.

Describe the bug
The Grokking demo currently fails execution

Code example
The block...

print(loss_fn(all_logits, labels)) # This bugged on models not fully trained  

Generate the following error....

RuntimeError                              Traceback (most recent call last)
[<ipython-input-88-6591fc338d6e>](https://xoc33mq2olp-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20240412-060119_RC00_624124077#) in <cell line: 1>()
----> 1 print(loss_fn(all_logits, labels)) # This bugged on models not fully trained

[<ipython-input-18-45ad8e4e85fe>](https://xoc33mq2olp-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20240412-060119_RC00_624124077#) in loss_fn(logits, labels)
      4     logits = logits.to(torch.float64)
      5     log_probs = logits.log_softmax(dim=-1)
----> 6     correct_log_probs = log_probs.gather(dim=-1, index=labels[:, None])[:, 0]
      7     return -correct_log_probs.mean()
      8 train_logits = model(train_data)

RuntimeError: Size does not match at dimension 0 expected index [12769, 1] to be smaller than self [113, 113] apart from dimension 1

Skipping this block allows the demo to run for another block, but after that the demo errors out due to a memory error.

System Info
Describe the characteristic of your environment:

  • Colab T4 GPU

Additional context

Checklist

  • I have checked that there is no similar issue in the repo (required)
@bryce13950 bryce13950 added bug Something isn't working demo Creating a demo or tutorial labels Apr 16, 2024
@anthonyduong9
Copy link
Contributor

I can work on this today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working demo Creating a demo or tutorial
Projects
None yet
Development

No branches or pull requests

2 participants