Skip to content

[Wheel] Stage _structured_ranges.py into the combined wheel - #5030

Merged
staryxchen merged 1 commit into
kvcache-ai:mainfrom
staryxchen:fix/wheel-stage-structured-ranges
Oct 28, 2026
Merged

staryxchen merged 1 commit into
kvcache-ai:mainfrom
staryxchen:fix/wheel-stage-structured-ranges

Conversation

@staryxchen

Copy link
Copy Markdown
Collaborator

Description

#3954 added python/mooncake/_structured_ranges.py and a hard import from mooncake.structured_object_store, but scripts/build_wheel.sh never staged that module into mooncake-wheel. test-wheel-ubuntu therefore fails after installing the CI wheel:

ModuleNotFoundError: No module named 'mooncake._structured_ranges'

This PR only adds _structured_ranges.py to MIGRATED_PYTHON_MODULES and extends the packaging tests so the omission cannot regress. It does not change Store shutdown behavior or CUDA EP JIT packaging.

Related: #3954 (introduced the missing staging). Overlaps with #4865, which also stages this file but mixes it with the standalone-master ExitAfterShutdown change and drops CUDA_EP_JIT_DIR staging relative to current main. This PR is the dedicated, minimal wheel fix.

Suggested Merge Priority

  • P0 — Urgent: Critical security vulnerability, data loss/corruption, or widespread production outage requiring immediate action
  • P1 — High: Significant correctness or stability issue in existing functionality, or a regression blocking users without a practical workaround
  • P2 — Normal: Routine bug fix, validated performance/compatibility improvement, or new feature for a confirmed use case
  • P3 — Low: Experimental feature, optional enhancement, refactoring, or cleanup with no urgent user impact

After #3954, test-wheel-ubuntu fails on current main for every PR that runs the wheel install check (for example #5012). There is no workaround other than packaging the missing module.

Module

  • Transfer Engine (mooncake-transfer-engine)
  • Mooncake Store (mooncake-store)
  • Mooncake Conductor (mooncake-conductor)
  • Reshard (mooncake-reshard)
  • Mooncake EP (mooncake-ep)
  • Mooncake PG (mooncake-pg)
  • Integration (mooncake-integration)
  • P2P Store (mooncake-p2p-store)
  • Python Wheel (mooncake-wheel)
  • Common (mooncake-common)
  • Mooncake RL (mooncake-rl)
  • CI/CD
  • Docs
  • Other

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation update
  • Performance improvement
  • Other

How Has This Been Tested?

Test commands:

python -m pytest python/tests/packaging/test_project.py::test_structured_object_storage_has_one_authoritative_source python/tests/packaging/test_installed_wheel.py -q
pre-commit run --files scripts/build_wheel.sh python/tests/packaging/test_project.py python/tests/packaging/test_installed_wheel.py

Test results:

  • Unit tests pass
  • Integration tests pass (if applicable)
  • Manual testing done (describe below)

test_structured_object_storage_has_one_authoritative_source passed. The installed-wheel smoke tests skipped locally because MOONCAKE_TEST_WHEEL / MOONCAKE_TEST_LEGACY_WHEEL were unset. test-wheel-ubuntu on this PR is the verification that the installed wheel can import mooncake.structured_object_store.

Checklist

  • I have performed a self-review of my own code
  • I have formatted my code using ./scripts/code_format.sh
  • I have run pre-commit on the files changed in this PR and all hooks pass
  • I have updated the documentation (if applicable)
  • I have added tests to prove my changes are effective
  • For changes >500 LOC: I have filed an RFC issue

AI Assistance Disclosure

  • No AI tools were used
  • AI tools were used (specify below)

Cursor Grok 4.6 diagnosed the test-wheel-ubuntu failure from CI logs and applied the staging-list plus packaging-test changes. The submitter reviewed every changed line.

Made with Cursor

kvcache-ai#3954 added the module and a hard import from structured_object_store, but the
legacy wheel builder never copied it into mooncake-wheel, so test-wheel-ubuntu
failed with ModuleNotFoundError.

Co-authored-by: Cursor <cursoragent@cursor.com>
@staryxchen
staryxchen requested a review from Aionw October 28, 2026 06:58

@zxpdemonio zxpdemonio left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

@Bo-Vincent Bo-Vincent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions Bot added run-ci Tests size/S 0-99 changed lines (additions + deletions) labels Oct 28, 2026
@staryxchen
staryxchen merged commit 3fbd075 into kvcache-ai:main Oct 28, 2026
28 checks passed
@staryxchen
staryxchen deleted the fix/wheel-stage-structured-ranges branch October 28, 2026 11:38
huangxiaobai-ydmy added a commit to huangxiaobai-ydmy/Mooncake that referenced this pull request Oct 28, 2026
…index

On SIGTERM, skip walking metadata_shards_ via ExitAfterShutdown after
stopping RPC, admin, worker pool, and HTTP metadata (kvcache-ai#4856).

(Rebased onto main after kvcache-ai#5030; packaging commits dropped.)
huangxiaobai-ydmy added a commit to huangxiaobai-ydmy/Mooncake that referenced this pull request Oct 28, 2026
… full

BatchEvict now goes through MemoryEviction::OpLogReclaimer. Wait briefly
for OpLog writer slots on TASK_PENDING_LIMIT_EXCEEDED instead of ending
the whole eviction cycle (kvcache-ai#4818).

(Rebased onto main after kvcache-ai#5030; packaging commits dropped.)
huangxiaobai-ydmy added a commit to huangxiaobai-ydmy/Mooncake that referenced this pull request Oct 28, 2026
(Rebased onto main after kvcache-ai#5030; packaging commits dropped.)
huangxiaobai-ydmy added a commit to huangxiaobai-ydmy/Mooncake that referenced this pull request Oct 28, 2026
Dummy-client exports record the exporter's CUDA device ordinal, which is
relative to that process's CUDA_VISIBLE_DEVICES. Opening with
cudaSetDevice(handle.device_id) maps every worker's buffer onto the real
client's GPU 0 when CVD layouts differ. Match TENT NVLinkTransport: open
on the current device with lazy peer access and remember that local
ordinal for close.

Fixes kvcache-ai#4980

Signed-off-by: YDMY_Kirito <202200820046@mail.sdu.edu.cn>

(Rebased onto main after kvcache-ai#5030; packaging commits dropped.)
huangxiaobai-ydmy added a commit to huangxiaobai-ydmy/Mooncake that referenced this pull request Oct 28, 2026
Exporter ordinals are relative to CUDA_VISIBLE_DEVICES and cannot be
reused by the real client. Carry cudaDeviceGetPCIBusId in the handle and
resolve with cudaDeviceGetByPCIBusId on open; keep device_id for logging
and open on the caller device only for legacy empty pci_bus_id handles.

(Rebased onto main after kvcache-ai#5030; packaging commits dropped.)
huangxiaobai-ydmy added a commit to huangxiaobai-ydmy/Mooncake that referenced this pull request Oct 28, 2026
(Rebased onto main after kvcache-ai#5030; packaging commits dropped.)
huangxiaobai-ydmy added a commit to huangxiaobai-ydmy/Mooncake that referenced this pull request Oct 28, 2026
Default host_ip is 127.0.0.1, so multi-node init_process_group without
set_host_ip() publishes loopback and hangs rank 0. Resolve a local
interface address toward MASTER_ADDR (or via hostname) when still on
loopback; fail fast with a set_host_ip hint if MASTER_ADDR is clearly
multi-node and resolution fails.

Fixes kvcache-ai#4981

Signed-off-by: YDMY_Kirito <202200820046@mail.sdu.edu.cn>

(Rebased onto main after kvcache-ai#5030; packaging commits dropped.)
huangxiaobai-ydmy added a commit to huangxiaobai-ydmy/Mooncake that referenced this pull request Oct 28, 2026
Address review feedback on kvcache-ai#5007: keep the single-node loopback default
when MASTER_ADDR is unset/loopback, and only run route/hostname
derivation (or fail-fast) when MASTER_ADDR is a non-loopback host.
Extract the policy into a testable helper and add unit coverage for
loopback preservation, route preference, hostname fallback, explicit
set_host_ip precedence, and fail-fast.

Signed-off-by: YDMY_Kirito <202200820046@mail.sdu.edu.cn>

(Rebased onto main after kvcache-ai#5030; packaging commits dropped.)
huangxiaobai-ydmy added a commit to huangxiaobai-ydmy/Mooncake that referenced this pull request Oct 28, 2026
Debian/Ubuntu /etc/hosts maps the hostname to 127.0.1.1, which previously
passed the string-only loopback check and could be published as host_ip.
Parse with inet_pton, reject loopback discovery results, and cover the
127.0.1.1 hostname-fallback case in unit tests.

(Rebased onto main after kvcache-ai#5030; packaging commits dropped.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci size/S 0-99 changed lines (additions + deletions) Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants