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

only break long lines in unpacking #42

Merged
merged 5 commits into from
Mar 23, 2024
Merged

only break long lines in unpacking #42

merged 5 commits into from
Mar 23, 2024

Conversation

t-vi
Copy link
Collaborator

@t-vi t-vi commented Mar 22, 2024

No description provided.

@t-vi t-vi requested a review from carmocca March 22, 2024 01:47
@t-vi t-vi marked this pull request as ready for review March 22, 2024 01:47
Copy link
Contributor

@carmocca carmocca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you updated the backward trace. Here's what I used to check:

from litgpt import GPT
import thunder
import torch

# Use only two layers to keep the traces shorter for the demonstration
model = GPT.from_name("Llama-2-7b-hf", n_layer=2).cuda()
model = thunder.jit(model)
x = torch.randint(model.max_seq_length, (2, 5), device="cuda")
y = model(x)  # forward, this may take a bit

forward_trace = thunder.last_traces(model)[-1]
print(forward_trace)
trace = thunder.last_backward_traces(model)[-1]
print(trace)

thunder/core/prims.py Show resolved Hide resolved
thunder/core/prims.py Show resolved Hide resolved
thunder/core/prims.py Outdated Show resolved Hide resolved
@t-vi
Copy link
Collaborator Author

t-vi commented Mar 22, 2024

Thank you @carmocca

@t-vi t-vi enabled auto-merge (squash) March 22, 2024 18:47
@t-vi t-vi requested a review from carmocca March 22, 2024 22:00
Copy link
Contributor

@carmocca carmocca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!

Copy link
Collaborator

@lantiga lantiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stamped!

@t-vi t-vi merged commit 456be01 into main Mar 23, 2024
36 checks passed
@t-vi t-vi deleted the tom/line-breaks branch March 23, 2024 13:53
@carmocca
Copy link
Contributor

I didn't rerun my snippet after your last commits 😅. Opened #69

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.

3 participants