Skip to content

Commit a663526

Browse files
committed
revert acc compute
Signed-off-by: Ye Yu <[email protected]>
1 parent fc4551a commit a663526

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

modelopt/torch/speculative/plugins/megatron_eagle.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@
6868
except ImportError:
6969
warnings.warn("Fail to import megatron.core.post_training! EAGLE feature will be disable!")
7070

71-
try:
72-
from transformers.trainer_pt_utils import LabelSmoother
73-
74-
IGNORE_TOKEN_ID = LabelSmoother.ignore_index
75-
except ImportError:
76-
IGNORE_TOKEN_ID = -100
77-
7871

7972
def dict_to_config(
8073
architecture_config,
@@ -1152,7 +1145,7 @@ def forward(
11521145
eagle_top1 += self.eagle_module.d2t[eagle_top1]
11531146
top1_p = (
11541147
torch.eq(labels[:, i + ttt_step + 1 :], eagle_top1).sum()
1155-
/ (labels != IGNORE_TOKEN_ID).sum().item()
1148+
/ eagle_top1.numel()
11561149
)
11571150
acc.append(top1_p)
11581151

0 commit comments

Comments
 (0)