OpenNMT / OpenNMT/CTranslate2

Development issues with `fused_layers`

Open
#1,887 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
4.7k
Forks
536
Avg merge
12h 12m
Merged PRs (30d)
4

Description

I am working on adding support for lite-whisper: https://github.com/OpenNMT/CTranslate2/pull/1886, https://github.com/efeslab/LiteASR/issues/7

However, the existing fused layer logic does not work for the low rank qkv matrices used ln lite-whisper: paper for context. This is because a low-rank linear layer for any one of the qkv projection matrices has the potential to fall back to the full layer if the compression algorithm can't compress the layer without sacrificing accuracy. This means that in lite-whisper, the qkv layers in each encoder are a mix of Linear and LowRankLinear layers, preventing them from being fused since the two layer types are executed differently.

Example encoder layer with mix of Linear and LowRankLinear layers:
Image

Would it cause problems if this fused layer logic was removed? Would it be better if I removed this logic only when lite-whisper runs? Is there another work around that allows me to keep the fused layer concatenation logic even though the layers are different?

@minhthuc2502

Contributor guide

Open the contributing guide

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

The issue concerns fused layer logic and the interaction between Linear and LowRankLinear qkv projections in lite-whisper. Start by tracing the fused-layer implementation and the encoder layer construction; no source file or test is named. Done would require an agreed design and validation that mixed projection types work without breaking existing fused-layer behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.