sgl-project / sgl-project/SpecForge
[Feature] Improve multi-layer decoder of custom backends
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 347
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 41
Description
Checklist
- 1. If the issue you raised is not a feature but a question, please raise a discussion at https://github.com/sgl-project/SpecForge/discussions/new/choose Otherwise, it will be closed.
- 2. Please use English, otherwise it will be closed.
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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