Skip to content

fix: sync XCCL LoRA registry names in OpenAIServingModels#1025

Closed
stablegenius49 wants to merge 1 commit intoinclusionAI:mainfrom
stablegenius49:pr-factory/issue-1020-lora-registry-sync
Closed

fix: sync XCCL LoRA registry names in OpenAIServingModels#1025
stablegenius49 wants to merge 1 commit intoinclusionAI:mainfrom
stablegenius49:pr-factory/issue-1020-lora-registry-sync

Conversation

@stablegenius49
Copy link
Copy Markdown

Summary

  • cache pending XCCL LoRA metadata on the API server when /areal_set_update_weight_meta_lora succeeds
  • re-key openai_serving_models.lora_requests after /areal_update_weights_lora_xccl succeeds so the new versioned LoRA name is routable immediately
  • add a focused regression test for the registry rename helper without requiring the full vLLM/AReaL runtime stack

Testing

  • python3 -m pytest tests/test_vllm_lora_registry.py
  • python3 -m compileall areal/engine/vllm_ext/lora_registry.py areal/engine/vllm_ext/areal_vllm_server.py tests/test_vllm_lora_registry.py

Closes #1020

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the LoRA management within the OpenAI serving layer by introducing a mechanism to correctly synchronize LoRA registry names. It ensures that after an XCCL LoRA weight update, the system's internal registry (openai_serving_models.lora_requests) is promptly updated to reflect the new versioned LoRA names, preventing routing issues and improving the reliability of LoRA adapter management.

Highlights

  • LoRA Metadata Caching: Pending XCCL LoRA metadata is now cached on the API server upon successful /areal_set_update_weight_meta_lora calls.
  • LoRA Registry Re-keying: The openai_serving_models.lora_requests registry is re-keyed immediately after successful /areal_update_weights_lora_xccl operations to ensure new versioned LoRA names are routable.
  • Regression Test: A dedicated regression test has been added for the LoRA registry rename helper, operating independently of the full vLLM/AReaL runtime stack.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • areal/engine/vllm_ext/areal_vllm_server.py
    • Imported LoRA registry update functions (apply_pending_lora_registry_update, cache_pending_lora_registry_update).
    • Integrated caching of pending LoRA metadata after successful set_weight_meta_xccl_lora calls.
    • Integrated application of pending LoRA registry updates after successful update_weight_lora_xccl calls.
  • areal/engine/vllm_ext/lora_registry.py
    • Added a new module to manage pending LoRA registry updates.
    • Implemented cache_pending_lora_registry_update to store LoRA metadata for future re-keying.
    • Implemented apply_pending_lora_registry_update to update the openai_serving_models.lora_requests dictionary with new LoRA names.
    • Implemented clear_pending_lora_registry_update to remove cached data after application.
  • tests/test_vllm_lora_registry.py
    • Added a new test file for the LoRA registry functionality.
    • Included a DummyLoRARequest class for isolated testing.
    • Added test_apply_pending_lora_registry_update_rekeys_existing_request to verify successful re-keying.
    • Added test_apply_pending_lora_registry_update_returns_false_without_matching_request to test edge cases where no matching request is found.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a mechanism to synchronize LoRA registry names in OpenAIServingModels during XCCL-based weight updates. The changes involve caching LoRA metadata when it's set and then applying this cached information to re-key the LoRA requests in the serving layer after the update is complete. A new module, areal/engine/vllm_ext/lora_registry.py, encapsulates this logic cleanly. The implementation appears correct and addresses the described issue. Additionally, a new test file provides good coverage for the new functionality. I have one suggestion to improve the maintainability of the new test file by simplifying how the module under test is imported.

Comment on lines +5 to +22
_MODULE_PATH = (
Path(__file__).resolve().parents[1]
/ "areal"
/ "engine"
/ "vllm_ext"
/ "lora_registry.py"
)
_SPEC = spec_from_file_location("test_lora_registry", _MODULE_PATH)
assert _SPEC is not None and _SPEC.loader is not None
_lora_registry = module_from_spec(_SPEC)
_SPEC.loader.exec_module(_lora_registry)

apply_pending_lora_registry_update = (
_lora_registry.apply_pending_lora_registry_update
)
cache_pending_lora_registry_update = (
_lora_registry.cache_pending_lora_registry_update
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The method used to import the lora_registry module is unnecessarily complex and can be brittle. Dynamically loading a module from a file path makes the test suite harder to maintain, for example, if file paths change.

Assuming pytest is run from the project root (a standard practice), you can use a more idiomatic and robust absolute import. This would simplify the test setup significantly.

from areal.engine.vllm_ext.lora_registry import (
    apply_pending_lora_registry_update,
    cache_pending_lora_registry_update,
)

@garrett4wade
Copy link
Copy Markdown
Collaborator

Hi @stablegenius49,

Thank you for your contribution! We sincerely apologize for merging #1039 before noticing this PR. From what I can tell, #1039 seems to include a similar change. Is my understanding correct? If this PR introduces additional functionality, could you please resolve the conflicts and run pre-commit run --all-files to fix the CI? We'd be happy to review the PR again once that's done.

Sorry for the inconvenience, and thank you for your understanding!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

This pull request has been automatically marked as stale because it has not had recent activity within the last 14 days.

Please add a comment or push new commits to keep it active.

Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Fix update_weights_lora_xccl to update OpenAIServingModels with new versioned LoRA name

2 participants