Add tiny transformer LLM notebook#2163
Draft
cetagostini wants to merge 2 commits into
Draft
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Contributor
Author
|
Doing the notebook found a few things which were adding an overhead in xtensor, adjust and end-up being even faster now xtensor than plain tensor. |
ricardoV94
reviewed
May 22, 2026
ricardoV94
reviewed
May 22, 2026
Member
|
This is nice, I don't want the random xtensor changes, we need to investigate why it was not simplifying in your case, may be another symptom of #2056 or something else, but shouldn't be done in a docs PR |
5 tasks
Contributor
Author
|
@ricardoV94 follow some of your comments, and came up with this: #2164 |
twiecki
reviewed
May 26, 2026
| @@ -0,0 +1,1246 @@ | |||
| { | |||
Member
There was a problem hiding this comment.
Add a new gallery notebook demonstrating a tiny decoder-only transformer LLM implemented with pytensor/xtensor (doc/gallery/transformers/tiny_transformer_llm.ipynb). Update .gitignore to exclude AI tool artifacts, gallery downloaded data, and JupyterLab session files. Co-authored-by: Cursor <cursoragent@cursor.com>
298d02a to
7361598
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
matmuland keep outer products on the existing einsum fallback.tensordotreshape shapes and add focused regression coverage.Test plan
conda run -n pytensor-dev python -m ruff check pytensor/tensor/math.py pytensor/xtensor/rewriting/math.py tests/tensor/test_math.py tests/xtensor/test_math.py