Skip to content

Conversation

@alec-flowers
Copy link
Contributor

@alec-flowers alec-flowers commented May 29, 2025

Overview:

Address comments from #1181

Summary by CodeRabbit

  • Refactor
    • Renamed event publisher classes and configuration from KvEventPublisherFromZmq/KvEventPublisherFromZmqConfig to ZmqKvEventPublisher/ZmqKvEventPublisherConfig throughout the Python and Rust interfaces.
    • Updated import statements and constructor signatures to reflect the new class names.
  • Documentation
    • Improved comments for data parallel rank metrics to clarify their purpose and provide additional references.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 29, 2025

Walkthrough

This change set systematically renames the ZeroMQ event publisher classes and configuration across Rust, Python bindings, and usage sites, replacing KvEventPublisherFromZmq/KvEventPublisherFromZmqConfig with ZmqKvEventPublisher/ZmqKvEventPublisherConfig. Related imports, docstrings, and type references are updated for consistency. No functional or control flow changes are introduced.

Changes

Files/Paths Change Summary
launch/dynamo-run/src/subprocess/vllm_v1_inc.py Updated vLLM version in setup instructions; replaced ZeroMQ publisher imports and instantiation with new names.
lib/bindings/python/rust/lib.rs
lib/bindings/python/rust/llm/kv.rs
lib/bindings/python/src/dynamo/_core.pyi
lib/bindings/python/src/dynamo/llm/init.py
Renamed Python-exposed Rust structs/classes and updated all references, imports, and docstrings accordingly.
lib/llm/src/kv_router/publisher.rs Renamed Rust struct and impl block from KvEventPublisherFromZmq to ZmqKvEventPublisher.
lib/llm/src/kv_router/protocols.rs Expanded comment on data_parallel_rank field in ForwardPassMetrics struct; no code or logic changes.

Suggested labels

chore

Suggested reviewers

  • nnshah1
  • biswapanda
  • ryanolson

Poem

A rabbit hops with nimble feet,
Renaming code so neat and sweet.
From Kv to Zmq, the names align,
Across Rust and Python, all in line.
No logic changed, just cleaner code—
The garden’s paths are newly mowed! 🐇✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d784877 and 01e004e.

📒 Files selected for processing (7)
  • launch/dynamo-run/src/subprocess/vllm_v1_inc.py (3 hunks)
  • lib/bindings/python/rust/lib.rs (1 hunks)
  • lib/bindings/python/rust/llm/kv.rs (3 hunks)
  • lib/bindings/python/src/dynamo/_core.pyi (3 hunks)
  • lib/bindings/python/src/dynamo/llm/__init__.py (1 hunks)
  • lib/llm/src/kv_router/protocols.rs (1 hunks)
  • lib/llm/src/kv_router/publisher.rs (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
lib/bindings/python/src/dynamo/llm/__init__.py (1)
lib/bindings/python/rust/lib.rs (1)
  • _core (39-80)
launch/dynamo-run/src/subprocess/vllm_v1_inc.py (3)
lib/bindings/python/rust/lib.rs (1)
  • lease_id (472-478)
lib/llm/src/kv_router/publisher.rs (1)
  • kv_block_size (66-68)
lib/llm/src/kv_router.rs (1)
  • block_size (154-156)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Build and Test - vllm
  • GitHub Check: pre-merge-rust (lib/runtime/examples)
  • GitHub Check: pre-merge-rust (lib/bindings/python)
  • GitHub Check: pre-merge-rust (.)
🔇 Additional comments (12)
lib/bindings/python/src/dynamo/llm/__init__.py (1)

35-36:

✅ Verification successful

LGTM! Improved naming consistency with ZMQ prefix.

The renaming from KvEventPublisherFromZmq/KvEventPublisherFromZmqConfig to ZmqKvEventPublisher/ZmqKvEventPublisherConfig follows better naming conventions by placing the technology prefix first. This aligns with the broader renaming effort across the codebase.

Let me verify that all references to the old class names have been updated consistently across the codebase:


🏁 Script executed:

#!/bin/bash
# Description: Verify all references to old ZMQ event publisher names have been updated

# Search for any remaining references to old names
echo "Searching for old class names that should have been renamed..."
rg -i "KvEventPublisherFromZmq" --type py --type rust
echo "Searching for old config names that should have been renamed..."
rg -i "KvEventPublisherFromZmqConfig" --type py --type rust

# Verify new names are used correctly
echo "Verifying new class names are imported/used correctly..."
rg -A 2 -B 2 "ZmqKvEventPublisher" --type py --type rust

Length of output: 5012


ZMQ Prefix Renaming Verified and Complete

No usages of the old KvEventPublisherFromZmq or KvEventPublisherFromZmqConfig remain, and the new ZmqKvEventPublisher/ZmqKvEventPublisherConfig are correctly referenced across the codebase:

  • Python binding: lib/bindings/python/src/dynamo/llm/__init__.py
  • Rust-Python interop: lib/bindings/python/rust/lib.rs
  • Subprocess script: launch/dynamo-run/src/subprocess/vllm_v1_inc.py
  • Core implementation: lib/llm/src/kv_router/publisher.rs

No further action required.

lib/llm/src/kv_router/publisher.rs (2)

95-95: LGTM! Struct renaming improves naming consistency.

The struct name change from KvEventPublisherFromZmq to ZmqKvEventPublisher follows better naming conventions and is consistent with the broader renaming effort across the codebase.


103-103: LGTM! Implementation block correctly updated.

The implementation block correctly reflects the struct name change. No functional changes are introduced.

lib/llm/src/kv_router/protocols.rs (1)

44-46: LGTM! Excellent documentation enhancement.

The expanded comment provides valuable context by:

  1. Adding a reference URL to SGLang's blog post explaining data parallelism concepts
  2. Clarifying why data parallel rank tracking is needed (semi-independent ranks)
  3. Improving the field description from "backwards compatible" to more precise "Optional for backwards compatibility"

This enhancement improves code maintainability and developer understanding.

lib/bindings/python/rust/lib.rs (1)

64-65: LGTM! Python binding registration correctly updated.

The module registration correctly reflects the renamed Rust structs (ZmqKvEventPublisher and ZmqKvEventPublisherConfig), ensuring consistency between the Rust implementation and Python interface. This aligns with the import changes in the Python __init__.py file.

launch/dynamo-run/src/subprocess/vllm_v1_inc.py (2)

8-11: Update setup instructions to align with vLLM 0.9.0 compatibility

The comments now correctly reference v0.9.0 instead of a commit hash, which improves clarity and maintainability.


38-39: Consistent renaming of ZeroMQ event publisher imports

The imports for the renamed classes ZmqKvEventPublisher and ZmqKvEventPublisherConfig replace the old KvEventPublisherFromZmq* names, keeping Python bindings in sync with Rust.

lib/bindings/python/src/dynamo/_core.pyi (2)

582-590: Add type stubs for renamed ZmqKvEventPublisherConfig

The new stub correctly defines the Python-side config class with default values for zmq_endpoint and zmq_topic.


600-608: Add type stubs for ZmqKvEventPublisher

The new stub for ZmqKvEventPublisher matches the renamed class in the Rust binding and includes the shutdown method.

lib/bindings/python/rust/llm/kv.rs (3)

131-140: Rename Python binding struct to ZmqKvEventPublisherConfig

The new #[pyclass] pub struct ZmqKvEventPublisherConfig replaces the old KvEventPublisherFromZmqConfig, aligning with the upstream Rust rename.


143-156: Update constructor signature for ZmqKvEventPublisherConfig

The #[new] impl now accepts (worker_id, kv_block_size, zmq_endpoint, zmq_topic) with sensible defaults. This matches the Rust struct and Python stub.


167-174: Rename Python binding struct to ZmqKvEventPublisher and update instantiation

The struct and its #[new] method now reference llm_rs::kv_router::publisher::ZmqKvEventPublisher, replacing the old KvEventPublisherFromZmq. The call to start_background_task remains correct.

@grahamking grahamking changed the title fix: address reviewer comments fix: Renamed event publisher classes and configuration May 29, 2025
@alec-flowers alec-flowers merged commit f67dc38 into main May 29, 2025
16 checks passed
@alec-flowers alec-flowers deleted the aflowers/v1_publisher_fixes branch May 29, 2025 20:00
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.

3 participants