Skip to content

improve: honor in-script ENABLE_KVCACHED by deferring the autopatch gate to import time#325

Closed
ztang2370 wants to merge 1 commit into
ovg-project:mainfrom
ztang2370:improve/autopatch-env-control
Closed

improve: honor in-script ENABLE_KVCACHED by deferring the autopatch gate to import time#325
ztang2370 wants to merge 1 commit into
ovg-project:mainfrom
ztang2370:improve/autopatch-env-control

Conversation

@ztang2370
Copy link
Copy Markdown
Contributor

Summary

  • Make the autopatch hook registration unconditional in kvcached_autopatch.pth so vllm/sglang @when_imported hooks are always wired up at interpreter startup.
  • Move the enablement check into _env_enabled() at hook-fire time: explicit KVCACHED_AUTOPATCH wins, otherwise fall back to ENABLE_KVCACHED.

Improves pr #322 and fixes issue #320.

Behavior matrix

ENABLE_KVCACHED KVCACHED_AUTOPATCH Before After
1 1 or unset patches ✓ patches ✓
1 (set in-script) 1 or unset broken patches ✓
1 0 (vendored fork opt-out) no patch ✓ no patch ✓
unset unset no patch ✓ no patch ✓

@ztang2370 ztang2370 closed this May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant