-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
Generate: fix end to end compilation #32465
Conversation
self.register_buffer(f"key_cache_{idx}", torch.zeros(cache_shape, dtype=dtype, device=device)) | ||
self.register_buffer(f"value_cache_{idx}", torch.zeros(cache_shape, dtype=dtype, device=device)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.register_buffer
can't be compiled, but is needed for torch.export
@@ -1477,7 +1479,7 @@ def _get_cache(self, cache_implementation: str, max_batch_size: int, max_cache_l | |||
"config": self.config, | |||
"max_batch_size": max_batch_size, | |||
"max_cache_len": max_cache_len, | |||
"device": self.device, | |||
"device": device, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dropped this line in the end-to-end PR, in a rebase 😢 . self.device
can't be called at compilation time
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ge tthis merged asap! I don't see tests updates so I suppose everything was caught by our CI but slow CI not push ci right?
Correct, was caught by the slow ci :) |
What does this PR do?
As @zucchini-nlp noticed,
RUN_SLOW=1 py.test tests/models/llama/test_modeling_llama.py::LlamaModelTest::test_generate_compile_fullgraph
was failing onmain
This PR fixes it.
Ran locally: