Skip to content

[https://nvbugs/6640875][test] Stabilize LoRA KV scheduler tests and re-enable seven cases - #18949

Merged
yizhang-nv merged 3 commits into
NVIDIA:mainfrom
yizhang-nv:codex/unwaive-kv-scheduler-siblings
Sep 9, 2026
Merged

[https://nvbugs/6640875][test] Stabilize LoRA KV scheduler tests and re-enable seven cases#18949
yizhang-nv merged 3 commits into
NVIDIA:mainfrom
yizhang-nv:codex/unwaive-kv-scheduler-siblings

Conversation

@yizhang-nv

@yizhang-nv yizhang-nv commented Sep 9, 2026

Copy link
Copy Markdown
Member

Description

Stabilize the LoRA V1/V2 scheduler comparisons and restore execution of seven waived tests. The LoRA class now uses private MPI sessions so each LLM has a fresh worker lifecycle, and its default KV pool is capped at 8192 tokens (approximately 4 GiB for llama-7b-hf). The explicit eviction configuration and all prompts, scheduler options, and output assertions are preserved. Remove the LoRA chunked-prefill waiver for https://nvbugs/6640875.

Also restore execution of all six TestKVCacheV2Llama cases waived under https://nvbugs/6600098, https://nvbugs/6428002, and https://nvbugs/6462303 by removing their entries from tests/integration/test_lists/waives.txt.

#17823 removed these waivers after adding private MPI sessions and bounding the default Llama comparison KV pool. Commit 7583916 in #17975 subsequently restored all six removed Llama waivers, although its message and PR discussion described waiving the separate LoRA test. This change restores coverage for all six cases so their current behavior can be validated.

Historical evidence does not establish that all failures are fixed: all six tests passed in post-merge #2921 with commit e189237, which contains #17823. After the fix merged, pre-merge #55310 recorded an unexpected termination for test_eviction[cuda_graph], #55544 recorded a chunked-prefill timeout, and #55696 recorded a V1/V2 output mismatch for eviction with block reuse; all three tested commits include the fix. The last failure occurred on #17668, which changes KV cache V2 storage/lifecycle code, so it cannot be attributed to main solely from that PR result. Subsequent post-merge runs skipped these tests after the waivers were restored.

The original LoRA chunked-prefill test passed in the B200 baseline run; its historical hang was not reproduced. The baseline logs showed V1/V2 worker reuse and a 65.52 GiB KV allocation. These changes reduce memory pressure and isolate worker lifetimes, but do not establish the cause of the historical timeout or prove that the bug is resolved.

Test Coverage

  • B200 runtime validation: all four TestKVCacheV2LoRA cases passed in 283.06 seconds; chunked prefill took 73.06 seconds. Command: python3 -m pytest -s -vv tests/integration/defs/kv_cache/test_kv_cache_v2_scheduler.py::TestKVCacheV2LoRA --timeout=600 --timeout-method=thread.

  • Validation used this branch's Python source with existing compiled artifacts from the tekit-devel-yizhan 1.3.0rc26 runtime; it was not a fresh native build of the PR. Full stdout/stderr logs were retained. Fresh PR CI remains necessary.

  • Commit hooks passed, including waiver sorting/duplicate checks, AST test-list validation, and DCO validation.

  • Existing coverage re-enabled by this PR:

    • kv_cache/test_kv_cache_v2_scheduler.py::TestKVCacheV2LoRA::test_lora_chunked_prefill
    • kv_cache/test_kv_cache_v2_scheduler.py::TestKVCacheV2Llama::test_eviction[cuda_graph]
    • kv_cache/test_kv_cache_v2_scheduler.py::TestKVCacheV2Llama::test_overlap_scheduler[non_overlap]
    • kv_cache/test_kv_cache_v2_scheduler.py::TestKVCacheV2Llama::test_overlap_scheduler[overlap]
    • kv_cache/test_kv_cache_v2_scheduler.py::TestKVCacheV2Llama::test_token_budget_limited
    • kv_cache/test_kv_cache_v2_scheduler.py::TestKVCacheV2Llama::test_chunked_prefill
    • kv_cache/test_kv_cache_v2_scheduler.py::TestKVCacheV2Llama::test_eviction_with_block_reuse
  • Fresh DGX B200 CI validation is pending. Historical passes are not a substitute for validating this PR.

PR Checklist

  • Description explains the change and motivation.
  • Coding guidelines followed; existing tests provide coverage.
  • No API, dependency, ownership, or architecture changes.
  • Reviewed the repository checklist items applicable to this test stabilization and waiver change.

Dev Engineer Review

The change removes six obsolete TestKVCacheV2Llama waivers and adds an 8192-token KV-cache limit for LoRA scheduler tests across default and multi-adapter V1/V2 configurations. No public APIs change. Fresh DGX B200 validation remains pending because historical results include failures.

QA Engineer Review

The change modifies the waiver list and KV-cache scheduler integration tests. It removes six TestKVCacheV2Llama waivers and one LoRA chunked-prefill waiver. The new cache limit covers LoRA scheduler behavior and reduces unbounded-cache risk. Commit hooks, waiver checks, AST validation, and DCO validation passed. Fresh DGX B200 PyTorch-backend CI is required. Coverage verdict: needs follow-up.

Per-File QA Perspective

  • tests/integration/test_lists/waives.txt: Removes seven waiver entries. QA should verify the unwaived cases in fresh DGX B200 CI.
  • tests/integration/defs/kv_cache/test_kv_cache_v2_scheduler.py: Adds an 8192-token KV-cache limit to default and multi-adapter LoRA V1/V2 configurations. QA should verify LoRA scheduler behavior and cache bounding across all affected configurations.

Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com>
@yizhang-nv

Copy link
Copy Markdown
Member Author

/bot run --disable-fail-fast --gpu-type DGX_B200 --test-backend pytorch

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 12c102ed-5397-478b-b690-759d718d52ec

📥 Commits

Reviewing files that changed from the base of the PR and between 349ff17 and 315b498.

📒 Files selected for processing (2)
  • tests/integration/defs/kv_cache/test_kv_cache_v2_scheduler.py
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt

Included review availability: Your plan provides up to 12 included reviews per hour; 9 remain after this review.


Walkthrough

LoRA KV-cache v2 scheduler tests now use an 8192-token cache limit in default and multi-adapter configurations. The integration waiver list removes the LoRA chunked-prefill skip.

Changes

KV-cache v2 LoRA scheduler tests

Layer / File(s) Summary
Configure LoRA KV-cache limits
tests/integration/defs/kv_cache/test_kv_cache_v2_scheduler.py
Adds an 8192-token KV-cache limit to default and multi-adapter LoRA configurations while retaining the existing GPU memory fraction and V2 scheduler settings.
Update LoRA waiver entry
tests/integration/test_lists/waives.txt
Removes the TestKVCacheV2LoRA::test_lora_chunked_prefill skip waiver.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 315b4

This change bounds LoRA KV-cache integration tests to 8192 tokens and re-enables the chunked-prefill test. It does not alter product runtime behavior, and no merge-blocking risk is currently identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the NVBugs issue, the test-stabilization change, and the re-enablement of seven waived cases. It accurately summarizes the main changes.
Description check ✅ Passed The description includes the required Description, Test Coverage, and PR Checklist sections. It explains the motivation, implementation, re-enabled tests, validation results, limitations, and pending …
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #72372 [ run ] triggered by Bot. Commit: 40cb8e2 Link to invocation

Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com>
@yizhang-nv yizhang-nv changed the title [https://nvbugs/6428002][test] Re-enable KV scheduler chunked prefill and block reuse tests [https://nvbugs/6600098][test] Re-enable six Llama KV scheduler tests Sep 9, 2026
@yizhang-nv

Copy link
Copy Markdown
Member Author

/bot run --disable-fail-fast --gpu-type DGX_B200 --test-backend pytorch

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #72384 [ run ] triggered by Bot. Commit: 349ff17 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #72372 [ run ] completed with state ABORTED. Commit: 40cb8e2

Link to invocation

… bound KV cache

Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com>
@yizhang-nv
yizhang-nv requested review from a team as code owners September 9, 2026 09:30
@yizhang-nv yizhang-nv changed the title [https://nvbugs/6600098][test] Re-enable six Llama KV scheduler tests [https://nvbugs/6640875][test] Stabilize LoRA KV scheduler tests and re-enable seven cases Sep 9, 2026
@yizhang-nv

Copy link
Copy Markdown
Member Author

/bot run --disable-fail-fast --gpu-type DGX_B200 --test-backend pytorch

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #72393 [ run ] triggered by Bot. Commit: 315b498 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #72384 [ run ] completed with state ABORTED. Commit: 349ff17

Link to invocation

@yizhang-nv

Copy link
Copy Markdown
Member Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #72402 [ run ] triggered by Bot. Commit: 315b498 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #72393 [ run ] completed with state ABORTED. Commit: 315b498

Link to invocation

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #72402 [ run ] completed with state SUCCESS. Commit: 315b498
/LLM/main/L0_MergeRequest_PR pipeline #59422 completed with status: 'SUCCESS'

CI Report

Link to invocation

@yizhang-nv
yizhang-nv merged commit 52bc8e7 into NVIDIA:main Sep 9, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants