Skip to content

JIT compile inference func in LLM pretrain tutorial #197

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

windmaple
Copy link
Contributor

@windmaple windmaple commented Apr 24, 2025

@jakevdp
Copy link
Collaborator

jakevdp commented Apr 24, 2025

Can you describe the changes you made? The GitHub UI can't show the diff because it's too large. Is that expected? Given the title of the PR, I would expect a change of only a few lines.

TB makes the notebook blow up in size
@windmaple
Copy link
Contributor Author

windmaple commented Apr 25, 2025

Apparently loading tensorboard completely blows up the notebook in size (110KB -> 83MB); I've avoided doing that so that the notebook can render on GitHub now.

Previously for inference the input wasn't padded so JIT wasn't used. Now this is done properly and speed is much faster. Also streaming tokens out instead of batching them.

Screenshot 2025-04-25 at 10 36 27

I had to re-run the notebook, which trigged a lot of metadata and output changes in the notebook.

Btw, have you considered using ReviewNB so that nb diff is much easier to review? We used it for another project last year and it worked like a charm.

@jakevdp
Copy link
Collaborator

jakevdp commented Apr 25, 2025

The lint is failing because the CI expects jupytext version 1.15.2. Locally you can use pre-commit run --all-files to ensure that you're using the exact same package versions and commands as the CI. More info at https://jax-ai-stack--197.org.readthedocs.build/en/197/contributing.html#editing-an-existing-notebook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants