Skip to content
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

Open
wants to merge 9 commits into
base: habana_main
Choose a base branch
from
Open

Fix spec decoding warmup #906

wants to merge 9 commits into from

Conversation

yangw1234
Copy link

@yangw1234 yangw1234 commented Mar 11, 2025

  1. fix model runner base setting attr, otherwise setting mem_margin here will not be setting in the delegated inner model_runner
  2. skip warmup for proposer model now, because proposer.determine_num_available_blocks() is not called in spec_decoder_worker and is not implemented by other proposers.
  3. add previous_hidden_states to the warmup inputs to relevant proposer model.

@yangw1234 yangw1234 changed the title try fixing spec decoding warmup Fix spec decoding warmup Mar 13, 2025
@yangw1234 yangw1234 marked this pull request as ready for review March 13, 2025 20:05
@@ -258,3 +258,14 @@ def __init__(

def __getattr__(self, attr):
return getattr(self.model_runner, attr)

def __setattr__(self, name, value):
Copy link
Author

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.

@yangw1234
Copy link
Author

@xuechendi @michalkuligowski please help review

@yangw1234
Copy link
Author

The failed tests exists in other PRs and are not related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant