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

Make example generation work when the model is torch.compile-d #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

IggShaman
Copy link

Andrej mentions this issue a couple of times in the video. Apparently, when a model is compiled, it will fix its input and output tensor sizes. The training regime works with inputs of shape (B, T), currently configured to (64, 1024). Example generation works with input tensors of shapes (4, 8) ... (4, 32).
A simple workaround here is to pad example generation tensors to the (B, T) shape, and ignore extra rows. The same workaround applies to the hellaswag eval.
Unfortunately, this increases the computation time linearly to both the B and T, so quadratically overall.

@IggShaman IggShaman force-pushed the igshevchenko/make_model_compile_compatible_with_example_generation branch from dc054e5 to b50b3da Compare August 26, 2024 14:03
@IggShaman IggShaman force-pushed the igshevchenko/make_model_compile_compatible_with_example_generation branch from b50b3da to ea398de Compare August 26, 2024 14:10
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.

1 participant