-
Notifications
You must be signed in to change notification settings - Fork 754
[llava 13, 14, 15, 16/N] #4643
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
Merged
Merged
[llava 13, 14, 15, 16/N] #4643
Conversation
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
As titled. [ghstack-poisoned]
…reuse" As titled. [ghstack-poisoned]
…reuse" As titled. [ghstack-poisoned]
…reuse" As titled. [ghstack-poisoned]
…reuse" As titled. [ghstack-poisoned]
This refactoring is needed in order to extract out prefill() and run_model_step() out from runner so that these APIs become replaceable and easy to plugin and use. * prefill(): For the case where parallel prefill is enabled or not using kv cache, the model is able to accept a large block (more than 1) of tokens. For the other case where we have kv cache but parallel prefill is not enabled, we can only feed in 1 token every time. * run_model_step(): This function should not update the input. Instead it should run the model differently, depending on whether kv cache is enabled. This should return the next token directly. All the input update needs to happen in the generation loop. [ghstack-poisoned]
This refactoring is needed in order to extract out prefill() and run_model_step() out from runner so that these APIs become replaceable and easy to plugin and use. * prefill(): For the case where parallel prefill is enabled or not using kv cache, the model is able to accept a large block (more than 1) of tokens. For the other case where we have kv cache but parallel prefill is not enabled, we can only feed in 1 token every time. * run_model_step(): This function should not update the input. Instead it should run the model differently, depending on whether kv cache is enabled. This should return the next token directly. All the input update needs to happen in the generation loop. [ghstack-poisoned]
This refactoring is needed in order to extract out prefill() and run_model_step() out from runner so that these APIs become replaceable and easy to plugin and use. * prefill(): For the case where parallel prefill is enabled or not using kv cache, the model is able to accept a large block (more than 1) of tokens. For the other case where we have kv cache but parallel prefill is not enabled, we can only feed in 1 token every time. * run_model_step(): This function should not update the input. Instead it should run the model differently, depending on whether kv cache is enabled. This should return the next token directly. All the input update needs to happen in the generation loop. [ghstack-poisoned]
Last PR #4556 refactored run_model_step() so that it is suitable to be extracted out as a separate class. This new `TextDecoderRunner` provides 2 APIs: * step(tokens, start_pos) This API takes one or more tokens with start_pos and feed them into Module. Return a tensor of logits. * logits_to_token(logits) This API samples the result and returns a token. We don't expect this logic to change across different runners. [ghstack-poisoned]
This refactoring is needed in order to extract out prefill() and run_model_step() out from runner so that these APIs become replaceable and easy to plugin and use. * prefill(): For the case where parallel prefill is enabled or not using kv cache, the model is able to accept a large block (more than 1) of tokens. For the other case where we have kv cache but parallel prefill is not enabled, we can only feed in 1 token every time. * run_model_step(): This function should not update the input. Instead it should run the model differently, depending on whether kv cache is enabled. This should return the next token directly. All the input update needs to happen in the generation loop. Differential Revision: [D60840327](https://our.internmc.facebook.com/intern/diff/D60840327) [ghstack-poisoned]
Last PR #4556 refactored run_model_step() so that it is suitable to be extracted out as a separate class. This new `TextDecoderRunner` provides 2 APIs: * step(tokens, start_pos) This API takes one or more tokens with start_pos and feed them into Module. Return a tensor of logits. * logits_to_token(logits) This API samples the result and returns a token. We don't expect this logic to change across different runners. Differential Revision: [D60856571](https://our.internmc.facebook.com/intern/diff/D60856571) [ghstack-poisoned]
…ner" Last PR #4556 refactored run_model_step() so that it is suitable to be extracted out as a separate class. This new `TextDecoderRunner` provides 2 APIs: * step(tokens, start_pos) This API takes one or more tokens with start_pos and feed them into Module. Return a tensor of logits. * logits_to_token(logits) This API samples the result and returns a token. We don't expect this logic to change across different runners. Differential Revision: [D60856571](https://our.internmc.facebook.com/intern/diff/D60856571) [ghstack-poisoned]
Last PR #4556 refactored run_model_step() so that it is suitable to be extracted out as a separate class. This new `TextDecoderRunner` provides 2 APIs: * step(tokens, start_pos) This API takes one or more tokens with start_pos and feed them into Module. Return a tensor of logits. * logits_to_token(logits) This API samples the result and returns a token. We don't expect this logic to change across different runners. Differential Revision: [D60856571](https://our.internmc.facebook.com/intern/diff/D60856571) [ghstack-poisoned]
Depends on whether parallel or sequential prefill is chosen, prefill() calls `TextDecoderRunner.step()` to prefill prompt tokens to LLM. [ghstack-poisoned]
…to a new class" Depends on whether parallel or sequential prefill is chosen, prefill() calls `TextDecoderRunner.step()` to prefill prompt tokens to LLM. Differential Revision: [D60927756](https://our.internmc.facebook.com/intern/diff/D60927756) [ghstack-poisoned]
Depends on whether parallel or sequential prefill is chosen, prefill() calls `TextDecoderRunner.step()` to prefill prompt tokens to LLM. Differential Revision: [D60927756](https://our.internmc.facebook.com/intern/diff/D60927756) [ghstack-poisoned]
…to a new class" Depends on whether parallel or sequential prefill is chosen, prefill() calls `TextDecoderRunner.step()` to prefill prompt tokens to LLM. Differential Revision: [D60927756](https://our.internmc.facebook.com/intern/diff/D60927756) [ghstack-poisoned]
Depends on whether parallel or sequential prefill is chosen, prefill() calls `TextDecoderRunner.step()` to prefill prompt tokens to LLM. Differential Revision: [D60927756](https://our.internmc.facebook.com/intern/diff/D60927756) [ghstack-poisoned]
…to a new class" Depends on whether parallel or sequential prefill is chosen, prefill() calls `TextDecoderRunner.step()` to prefill prompt tokens to LLM. Differential Revision: [D60927756](https://our.internmc.facebook.com/intern/diff/D60927756) [ghstack-poisoned]
Depends on whether parallel or sequential prefill is chosen, prefill() calls `TextDecoderRunner.step()` to prefill prompt tokens to LLM. Differential Revision: [D60927756](https://our.internmc.facebook.com/intern/diff/D60927756) [ghstack-poisoned]
So that it can be reused [ghstack-poisoned]
So that it can be reused Differential Revision: [D60938984](https://our.internmc.facebook.com/intern/diff/D60938984) [ghstack-poisoned]
So that it can be reused Differential Revision: [D60938984](https://our.internmc.facebook.com/intern/diff/D60938984) [ghstack-poisoned]
Differential Revision: D60938984 Pull Request resolved: #4588
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/4643
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit e79c362 with merge base 92edd04 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
kirklandsign
approved these changes
Aug 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
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.
No description provided.