Runtime Draft Weight Update for Speculative Decoding (#46725)
Signed-off-by: vx120 <893600387@qq.com> Signed-off-by: vx120 <57470515+vx120@users.noreply.github.com> Signed-off-by: aoshen02 <aoshen@inferact.ai> Co-authored-by: crp0128 <191679376@qq.com> Co-authored-by: aoshen02 <aoshen@inferact.ai> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
crp0128
aoshen02
Claude Opus 4.8
parent
481e481be7
commit
fc1c548093
@@ -3282,6 +3282,17 @@ class GPUModelRunner(
|
||||
return self.model.unwrap()
|
||||
return self.model
|
||||
|
||||
def get_draft_model(self) -> nn.Module | None:
|
||||
drafter = getattr(self, "drafter", None)
|
||||
if drafter is None:
|
||||
return None
|
||||
model = getattr(drafter, "model", None)
|
||||
if isinstance(
|
||||
model, (CUDAGraphWrapper, UBatchWrapper, BreakableCUDAGraphWrapper)
|
||||
):
|
||||
return cast(nn.Module, model.unwrap())
|
||||
return cast(nn.Module | None, model)
|
||||
|
||||
def get_supported_generation_tasks(self) -> list[GenerationTask]:
|
||||
model = self.get_model()
|
||||
supported_tasks = list[GenerationTask]()
|
||||
|
||||
Reference in New Issue
Block a user