OpenGVLab / OpenGVLab/VideoChat-Flash

Bug in inference mode?

Open
#54 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
530
Forks
20
PR merge metrics
No merged PRs in 30d

Description

I found that, in the code, if hidden_states.shape[1] != 1: is used to detect prefill stage.

I thought this criteria sometimes goes wrong. In my experiments, the hidden_states.shape was:

  • hidden_states.shape[1] = n: prefill
  • hidden_states.shape[1] =1: when generating the 2nd token
  • hidden_states.shape[1] =2: when generating the 3rd token
  • hidden_states.shape[1] =3: when generating the 4th token
    ...

So I have two questions:

  1. Can hidden_states.shape[1] consistently equals to 1 (instead of 1,2,3,...) after prefilling if I use some generating setting?
  2. Would position_ids[0,0] == 0 be a robuster criteria than hidden_states.shape[1] != 1 to detect prefill?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the inference code containing if hidden_states.shape[1] != 1: and trace how hidden_states and position_ids are produced during generation. Compare the observed shapes under relevant generation settings, then document which signal reliably identifies prefill and define the resulting code change or recommendation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.