Skip to content

test(npu): add C128SidecarComponent unified-cache contract regression test - #1202

Open
EdwardXuy wants to merge 2 commits into
Ascend:mainfrom
EdwardXuy:test-npu-c128-sidecar-unevict-contract
Open

EdwardXuy wants to merge 2 commits into
Ascend:mainfrom
EdwardXuy:test-npu-c128-sidecar-unevict-contract

Conversation

@EdwardXuy

@EdwardXuy EdwardXuy commented Sep 1, 2026

Copy link
Copy Markdown

Summary

sgl-project/sglang PR sgl-project#37091 ([Unified Cache][1/N]: Support cache contract for external linker) added a required
esult: InsertResult parameter to several TreeComponent lifecycle hooks, and the insert walk now calls them with
esult=... as a keyword argument.

The NPU C128SidecarComponent (auto-registered for DeepSeek-V4 into the unified radix cache) overrides
ecover_after_unevict with the old signature, which makes the evict -> unevict path raise:

TypeError: recover_after_unevict() got an unexpected keyword argument 'result'

What this PR does

Adds a CPU unit test ( est_npu_c128_sidecar_contract.py) that asserts the NPU sidecar stays signature-compatible with the base TreeComponent contract methods (update_component_on_insert_overlap,
ecover_after_unevict, commit_insert_component_data).

This reproduces the bug: it fails on main and passes once C128SidecarComponent.recover_after_unevict accepts
esult: InsertResult.

CI

Registered via
egister_cpu_ci (CPU suite); no NPU image / model is required.


CI States

Latest PR Test (Base): ❌ Run #33490869887
Latest PR Test (Extra): ❌ Run #33490870065
Latest PR Test (AMD ROCm 7.2): ❌ Run #33490869852

sgl-project/sglang PR sgl-project#37091 added result: InsertResult to several TreeComponent hooks and the insert walk now calls them with result=.... C128SidecarComponent.recover_after_unevict still uses the old signature and raises TypeError on the evict->unevict path. Add a signature-parity unit test so the NPU subclass cannot drift from the base contract.
@ascend-robot

Copy link
Copy Markdown

CLA Signature Guide

@EdwardXuy , thanks for your pull request.

The following commit(s) are not associated with a signed Contributor License Agreement (CLA).

Commit Reason
e3869d71 test(npu): guard C128SidecarComp... the email used in the commit is not linked to a signed CLA!
please verify that it matches the email you used when signing the CLA.

To sign CLA, click here.

To check if your email is configured correctly, refer to the FAQs.

Once you've signed the CLA or updating your email, please comment /check-cla to revalidate CLA status.

@github-actions github-actions Bot added the npu label Sep 1, 2026
@ascend-robot

Copy link
Copy Markdown

CLA Signature Guide

@EdwardXuy , thanks for your pull request.

The following commit(s) are not associated with a signed Contributor License Agreement (CLA).

Commit Reason
e3869d71 test(npu): guard C128SidecarComp... the email used in the commit is not linked to a signed CLA!
please verify that it matches the email you used when signing the CLA.

To sign CLA, click here.

To check if your email is configured correctly, refer to the FAQs.

Once you've signed the CLA or updating your email, please comment /check-cla to revalidate CLA status.

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.

2 participants