Skip to content

Clarification on d2t and t2d Mapping Logic in EAGLE-3 Draft Model #222

@junghye01

Description

@junghye01

Hi, thank you for the great work on this project.

I was reviewing the Model class in model/cnets.py and noticed that d2t and t2d are declared within the class. Since EAGLE-3 appears to use its own lm_head for the draft model—rather than sharing the target model's lm_head—I assume there's an intended mapping process from the draft vocab indices to the target vocab indices.

self.lm_head=nn.Linear(config.hidden_size,config.draft_vocab_size,bias=False)
d2t=torch.zeros((config.draft_vocab_size),dtype=torch.long)
t2d=torch.zeros((config.vocab_size),dtype=torch.bool)

However, when I debugged using the official checkpoint, I found that all values in the d2t tensor are initialized to 0. This makes it unclear how the draft tokens are correctly mapped to the target model's vocabulary space during inference.

ss_token.append(topk_index + self.d2t[topk_index])
input_ids = topk_index + self.d2t[topk_index]

Could you clarify how the d2t and t2d mappings are supposed to be constructed or loaded? Any explanation or pointer would be greatly appreciated.

Thanks again for your work and support!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions