Qwen icon indicating copy to clipboard operation
Qwen copied to clipboard

position_ids not used

Open jiqizaisikao opened this issue 1 year ago • 2 comments

Hi,why the var position_ids calculated but not used :

if position_ids is None:

  | position_ids = torch.arange(   | past_length,   | input_shape[-1] + past_length,   | dtype=torch.long,   | device=device,   | )   | position_ids = position_ids.unsqueeze(0).view(-1, input_shape[-1])

Thanks!

jiqizaisikao avatar Dec 02 '23 00:12 jiqizaisikao

I wanted to ask just the same question)

For example, in Llama and Falcon, position_ids is used in apply_rotary_pos_emb function. However, Qwen uses another version of apply_rotary_pos_emb, which is without position_ids...

Alvant avatar Dec 07 '23 22:12 Alvant

Hello, I think it should be safe to remove that part of code. position_ids is no longer needed for this implementation.

We are in the process of cleaning up code that does not seem meaningful anymore. But as you know, it is a tricky job... so no time guarantee.

Best,

jklj077 avatar Dec 13 '23 12:12 jklj077