perf(server): keep CUDA graph replay when LoRA adapters are loaded
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- machine-learning, performance
Research direction
Start at packages/sie_server/src/sie_server/adapters/modernbert_flash/__init__.py and the guard if self._graphs is None or self._peft_model is not None: return None; compare the base and adapter request paths with the graph-capture code cited in #423/#721. Read draft #829 for the runtime-LoRA direction and #647 for Qwen3 batching. Done means base and adapted requests replay graphs on ModernBERT/ColBERT and GLiNER2.5-Decide, parity stays within 0.02 of eager, L4 p50 is reported, and adapter eviction frees recordings within the existing memory budget.
Written by the indexing model from the issue text.
Description
Problem
Loading a LoRA adapter takes a model off CUDA graph replay, and on short encoder calls the eager path is several times slower.
- On main, the ModernBERT and ColBERT flash adapters run every request eagerly once any PEFT LoRA is loaded, base-model requests included (
packages/sie_server/src/sie_server/adapters/modernbert_flash/__init__.py:if self._graphs is None or self._peft_model is not None: return None). Forgte-modernbert-baseon an L4, graphs are worth 17.5 → 2.4 ms per query (#423). - Draft #829 (runtime LoRA for GLiNER2.5-Decide, Laya, pplx-decider and GLiClass) keeps graphs for base requests, but adapted requests run eagerly. Eager Decide on an L4 is 46.8 ms p50 against 8.4 ms with graphs (#721), so a tuned Decide would be about 5x slower than the base it was tuned from.
- Qwen3-Embedding-4B gives up its four batches in flight when LoRA is configured (#647).
Goal
Requests that select a LoRA adapter replay recorded graphs as base requests do, under the same numerics rule as the other graph work: no probability moves more than 0.02 against eager, or the result is no worse against float32.
Possible approaches
- Static adapter buffers. Capture graphs with the LoRA A/B matrices read from fixed buffers. Before replay, copy the selected adapter's weights into those buffers, so adapters swap without a recapture. Needs one graph set per rank and target-module layout.
- Per-adapter recordings for hot adapters. Record a graph set per (adapter, bucket) inside the existing graph memory budget, and evict a recording together with its adapter in the LoRA LRU.
- Merge at staging. Merge a hot adapter into a copy of the base weights and record graphs for that copy. Simplest numerically, but it costs memory per adapter.
Whichever approach is chosen, base-model graphs must stay unaffected when adapters are loaded.
Acceptance
- Base requests keep graph replay while any adapter is loaded, starting with the ModernBERT and ColBERT flash adapters.
- Adapted requests replay graphs on GLiNER2.5-Decide and at least one ModernBERT model. Report parity numbers and L4 p50 before and after.
- Graph memory stays within the existing budget, and evicting an adapter frees its recordings.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 328
- Avg merge
- 17h 8m
- Merged PRs (30d)
- 108
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from superlinked/sie
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
superlinked/sie#1033 ·
Maintainers usually reply within 1 day
-
LoRA source resolver rejects shared cache blobs accepted by serving-artifact validationPossibly taken @draarivpatel-ui claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
superlinked/sie#1001 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 15/100
superlinked/sie#1013 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
superlinked/sie#969 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
superlinked/sie#892 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
reflex-dev/reflex#8026 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/ponymail-foal#365 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
NousResearch/hermes-labs-plugins#116 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
gcivil-nyu-org/team-3-fall26#192 ·
Maintainers usually reply within 1 day
-
[Study plan] Study sessions can be rescheduled to any length (e.g. 72 hours) with no length checkOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gcivil-nyu-org/team-2-fall26#159 ·
Maintainers usually reply within 1 day