[EAGLE] Prune draft-extend logits to selected rows (#35546)
This commit is contained in:
@@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
import dataclasses
|
||||
from dataclasses import dataclass, fields
|
||||
from typing import Dict, Tuple
|
||||
from typing import Collection, Dict, Tuple
|
||||
|
||||
import torch
|
||||
|
||||
@@ -68,13 +68,15 @@ class ForwardInputBuffers:
|
||||
if buffer is not None:
|
||||
buffer.zero_()
|
||||
|
||||
def share_buffers(self):
|
||||
def share_buffers(self, *, exclude: Collection[str] = ()):
|
||||
# disable share input buffer on npu due to accuracy issue
|
||||
if is_npu():
|
||||
return
|
||||
|
||||
for f in fields(self):
|
||||
name = f.name
|
||||
if name in exclude:
|
||||
continue
|
||||
buffer = getattr(self, name)
|
||||
|
||||
if buffer is None:
|
||||
|
||||
Reference in New Issue
Block a user