OpenGVLab / OpenGVLab/Ask-Anything

sequential ` for samples in batch` loop in Videochat2 is slow, any ways to parallalize it ?

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

Nobody has claimed this yet.

Dominant language
Python
Stars
3.4k
Forks
268
PR merge metrics
No merged PRs in 30d

Description

Hi, dear all:
I noticed a sequential for loop in videochat2_it.py forward function:

https://github.com/OpenGVLab/Ask-Anything/blob/078540aaebfbe1ad9a109020a73b0ce173b355ef/video_chat2/models/videochat2_it.py#L240-L288

As most of tensor computation is parallel, any good idea to implement the for loop parallel?

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 reading the forward function in video_chat2/models/videochat2_it.py around lines 240-288 and measure the current sequential loop. Compare any proposed approach against the existing behavior and timing; the work is done when a safe parallelization strategy is demonstrated to improve performance.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning, performance
Issue type
Refactor
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.