-
Notifications
You must be signed in to change notification settings - Fork 81
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
Fix spec decoding warmup #906
base: habana_main
Are you sure you want to change the base?
Conversation
@@ -258,3 +258,14 @@ def __init__( | |||
|
|||
def __getattr__(self, attr): | |||
return getattr(self.model_runner, attr) | |||
|
|||
def __setattr__(self, name, value): |
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.
@michalkuligowski The purpose of this class is to imitate the behavior of a regular model runner and delegate all methods, attributes access to the self.model_runner
.
Adding __setattr__
here is to solve the problem when setting a attr in base and use it later. E.g.
model_wrapper = ModelRunnerWrapperBase(hpu_model_runner)
model_wrapper.mem_margin = some_value
model_wrapper.mem_margin
model_wrapper.mem_margin = some_value
this line will set a attr to the base class if we do not have __setattr__
, but when we want to get the value by model_wrapper.mem_margin
, the base class will delegate the access to self.model_runner
which does not have this property and causing an error.
@xuechendi @michalkuligowski please help review |
The failed tests exists in other PRs and are not related. |
mem_margin
here will not be setting in the delegated innermodel_runner
proposer.determine_num_available_blocks()
is not called inspec_decoder_worker
and is not implemented by other proposers.previous_hidden_states
to the warmup inputs to relevant proposer model.