sgl-project / sgl-project/SpecForge

[Feature] Improve multi-layer decoder of custom backends

Open
#418 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.2k
Forks
347
Avg merge
4d 1h
Merged PRs (30d)
41

Description

Checklist
Motivation

Most of the custom backends of SpecForge forward their multiple decoder layers with shared caches (including cache_position and past_key_values). It is possible to create separate caches for each decoder layer for better cache utilization.

Related resources

There isn't too much documentation/benchmarks around cache_position. The name seems to suggest it is a cache used by a decoder layer.

past_key_values, however, are usually typed as containers of tensors of dimension num_hidden_layers/n_layers on huggingface across models.

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 custom backend decoder implementations and tracing how cache_position and past_key_values are forwarded across decoder layers. Compare their current behavior with the linked Hugging Face GPT2, Transformer XL, and LayoutLM cache descriptions; done means defining and validating the separate-cache behavior, including its cache-utilization impact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
backend, machine-learning
Issue type
Feature
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.