Repository navigation
Conversation
Signed-off-by: bojiang-li <[email protected]>
|
👋 Hi bojiang-li! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
Signed-off-by: bojiang-li <[email protected]>
|
/ok to test 4926fac |
✅ Dynamo PR CI passed — run 41546985792 (attempt 1) on
|
Merge upstream/main at f24c59b, including the aisimulate dependency update in b208989. The PR remains scoped to transfer preparation cleanup. Assisted-by: Codex Signed-off-by: bojiang-li <[email protected]>
|
Thanks for enabling CI. The planner image in run 38982928369 failed during cargo metadata because aisimulate-core =0.13.0-dev.202610060000000067 was unavailable. I merged main at f24c59b, including the dependency update from #16077. The new head is d2268ca. The PR still changes only the two transfer cleanup files relative to main. All 41 transfer tests pass on DGX Spark, including real shared memory round trips and all ten preparation ownership cases. Full touched-file pre-commit also passes. Native NIXL and GPU serving were not tested. @krishung5 could you authorize full CI for the new head when convenient? Thank you. |
|
/ok to test ba3087f |
Signed-off-by: bojiang-li <[email protected]>
|
/ok to test d7ef5ad |
|
@bojiang-li @krishung5, a note from a review of this PR after the merge. [P3] No test makes sure that a failed SHM release keeps the original preparation error. Measured in the CI test image of d7ef5ad, in a container with no network.
The same break in NIXL The test to add, 31 lines. It applies to `main` at 319ad3b, and `ruff check` passes.--- a/components/src/dynamo/common/tests/multimodal/test_mm_kwargs_transfer.py
+++ b/components/src/dynamo/common/tests/multimodal/test_mm_kwargs_transfer.py
@@ -173,6 +173,37 @@
handles[0].unlink.assert_called_once_with()
@pytest.mark.asyncio
+ @pytest.mark.parametrize("failure_site", ["item_metadata", "batch_metadata"])
+ async def test_shm_release_failure_keeps_preparation_error(
+ self, monkeypatch, failure_site
+ ):
+ handles, _ = self._shm_boundary(monkeypatch)
+ sender = MmKwargsShmSender()
+ failure = OSError(errno.ENOSPC, "controlled preparation failure")
+
+ def fail(*args, **kwargs):
+ # A failed unlink must not replace the preparation error or stop
+ # the release of later segments.
+ handles[0].unlink.side_effect = OSError(errno.EIO, "release failed")
+ raise failure
+
+ if failure_site == "item_metadata":
+ monkeypatch.setattr(mm_kwargs_transfer, "MmKwargsShmItem", fail)
+ else:
+ monkeypatch.setattr(sender, "_assemble_extra_args", fail)
+
+ with pytest.raises(OSError) as caught:
+ await sender.prepare(
+ [_make_feature(data=_make_kwargs_item(i)) for i in range(2)]
+ )
+
+ assert caught.value is failure
+ assert len(handles) == (2 if failure_site == "batch_metadata" else 1)
+ for handle in handles:
+ handle.close.assert_called_once_with()
+ handle.unlink.assert_called_once_with()
+
+ @pytest.mark.asyncio
@pytest.mark.parametrize(
"failure_site", ["registration", "item_metadata", "batch_metadata"]
) |
Summary
Fixes #16056.
Keep ownership of multimodal transfer resources until preparation returns successfully. A sender can create the first shared memory segment or NIXL registration, then fail on the next item and return no cleanup handles. That leaves the first resource without an owner.
The sender now releases resources if serialization, allocation, registration, metadata construction, or cancellation prevents preparation from returning. Each item encoder also cleans its own resource if it fails before handing back a cleanup handle. Cleanup keeps the original preparation error.
For unpublished NIXL registrations, release directly because no receiver has their metadata yet. Successful transfers still hand cleanup to the caller and keep their existing completion wait. This does not change cleanup after a transfer has been published.
Merged current main and kept its typed msgpack serializer, buffer framing, and decoder restrictions. The new tests use real vLLM multimodal items.
Validation
All 41 tests in the transfer module pass on Linux ARM64 with vLLM 0.27.1. That includes real POSIX shared memory round trips, buffer framing, restricted decoding, NIXL ordering, and all ten preparation ownership cases. On unchanged current main, those ten cases produce eight failures and two successful controls. The file checks pass.
The test runner loads the actual transfer module and vLLM serializer while skipping unrelated native package bootstraps. Shared memory round trips use the real OS implementation. Ownership failure cases control the shared memory or NIXL operation boundary. Native NIXL registration, RDMA, GPU serving, and performance were not tested.
AI assistance was used for the code, tests, and review.