-
Notifications
You must be signed in to change notification settings - Fork 60
Refactor input normalization by replaying inputs for consistent preprocessing #1094
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
Conversation
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>
for more information, see https://pre-commit.ci
…nto fix-attn-mask
Signed-off-by: yiliu30 <yi4.liu@intel.com>
|
|
||
| def _preprocess_block_inputs(self, inputs, first_input_name="input_ids"): | ||
| input_ids, input_others = self._split_inputs(inputs, first_input_name) | ||
| clear_memory(device_list=self.device_list) |
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 don''t know why clear_memory is needed here. @n1ck-guo do you know?
| input_ids, input_others = normalize_input(inputs) | ||
| self.normalize_decoding_layer_inputs_(inputs) | ||
| block_inputs = self.inputs[self.quant_block_list[0][0]] | ||
| decoding_layer_first_input_name = "hidden_states" |
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.
does the origin code have such assumption? Is there any case that the first_input_name is not hidden_states
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.
The origin code replaces the hidden_states with input_ids.
Signed-off-by: yiliu30 <yi4.liu@intel.com>
No description provided.