-
Notifications
You must be signed in to change notification settings - Fork 68
removed duplication of mdp_json_path in compilation command (#706)
#779
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
Open
ochougul
wants to merge
2
commits into
main
Choose a base branch
from
706_cherry
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+363
−16
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2747,10 +2747,12 @@ def build_prefill_specialization( | |
| Dict[str, Union[int, str]] | ||
| A dictionary defining the prefill specialization. | ||
| """ | ||
| if prefill_seq_len == 1 and self.continuous_batching: | ||
| if not self.continuous_batching: | ||
| exec_batch_size = batch_size | ||
| elif prefill_seq_len == 1: | ||
| exec_batch_size = full_batch_size | ||
| else: | ||
| exec_batch_size = 1 if self.continuous_batching else batch_size | ||
| exec_batch_size = 1 | ||
|
|
||
| if hasattr(self.model, "get_specializations"): | ||
| spec = self.model.get_specializations( | ||
|
|
@@ -2761,7 +2763,7 @@ def build_prefill_specialization( | |
| )[0] | ||
| else: | ||
| spec = { | ||
| "batch_size": 1 if self.continuous_batching else batch_size, | ||
| "batch_size": exec_batch_size, | ||
| "seq_len": prefill_seq_len, | ||
| "ctx_len": ctx_len, | ||
| } | ||
|
|
@@ -2772,8 +2774,9 @@ def build_prefill_specialization( | |
| spec["full_batch_size"] = kv_cache_batch_size | ||
| else: | ||
| spec["batch_size"] = kv_cache_batch_size | ||
| # TODO: remove this; not required | ||
| if full_batch_size: | ||
| spec["full_batch_exec_size"] = full_batch_size | ||
| spec["full_batch_exec_size"] = exec_batch_size | ||
| return {k: v for k, v in spec.items() if v is not None} | ||
|
|
||
| def build_decode_specialization( | ||
|
|
@@ -2811,9 +2814,6 @@ def build_decode_specialization( | |
| A dictionary defining the decode specialization, or None if it would be a duplicate | ||
| of the prefill specialization (e.g., if prefill_seq_len is 1 and not continuous batching). | ||
| """ | ||
| if prefill_seq_len == 1 and not self.continuous_batching: | ||
| return None # Avoid duplication with prefill | ||
|
|
||
| if hasattr(self.model, "get_specializations"): | ||
| spec = self.model.get_specializations( | ||
| batch_size=full_batch_size if self.continuous_batching else batch_size, | ||
|
|
@@ -3031,7 +3031,7 @@ def compile( | |
| ) | ||
| ) | ||
|
|
||
| if prefill_only is None or not prefill_only: | ||
| if (prefill_only is None or not prefill_only) and prefill_seq_len != 1: | ||
| if self.comp_ctx_lengths_decode is not None: | ||
| # Adding elements from self.comp_ctx_lengths_decode to decode_specialization | ||
| for i in range(0, len(self.comp_ctx_lengths_decode)): | ||
|
|
@@ -3060,6 +3060,8 @@ def compile( | |
| if decode_spec: | ||
| specializations.append(decode_spec) | ||
|
|
||
| if kw_spec := compiler_options.pop("specializations", None): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: This can be simplified to |
||
| specializations = kw_spec | ||
| # --- Compilation --- | ||
| kv_cache_dtype = "mxint8" if mxint8_kv_cache else "float16" | ||
| custom_io = {} | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Can we set the prefill_only to false as default value?