Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
76f2ef91
Unverified
Commit
76f2ef91
authored
Oct 28, 2025
by
milesial
Committed by
GitHub
Oct 28, 2025
Browse files
feat: b64 encoding for nixl_connect metadata (#3843)
parent
12083e9c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
lib/bindings/python/src/dynamo/nixl_connect/__init__.py
lib/bindings/python/src/dynamo/nixl_connect/__init__.py
+15
-5
No files found.
lib/bindings/python/src/dynamo/nixl_connect/__init__.py
View file @
76f2ef91
...
...
@@ -16,6 +16,7 @@
from
__future__
import
annotations
import
asyncio
import
base64
import
logging
import
socket
import
uuid
...
...
@@ -1185,7 +1186,7 @@ class PassiveOperation(AbstractOperation):
case
_
:
return
def
metadata
(
self
)
->
RdmaMetadata
:
def
metadata
(
self
,
hex_encode
:
bool
=
False
)
->
RdmaMetadata
:
"""
Gets the request descriptor for the operation.
"""
...
...
@@ -1209,9 +1210,14 @@ class PassiveOperation(AbstractOperation):
f
"dynamo.nixl_connect.
{
self
.
__class__
.
__name__
}
: Compressed NIXL metadata is larger than original (
{
compressed_len
}
>
{
original_len
}
)."
)
if
not
hex_encode
:
encoded_metadata
=
base64
.
b64encode
(
nixl_metadata
).
decode
(
"utf-8"
)
encoded_metadata
=
"b64:"
+
encoded_metadata
else
:
encoded_metadata
=
nixl_metadata
.
hex
()
self
.
_serialized_request
=
RdmaMetadata
(
descriptors
=
descriptors
,
nixl_metadata
=
nixl
_metadata
.
hex
()
,
nixl_metadata
=
encoded
_metadata
,
notification_key
=
self
.
_notification_key
,
operation_kind
=
int
(
self
.
_operation_kind
),
)
...
...
@@ -1471,10 +1477,14 @@ class Remote:
self
.
_connector
=
connector
# When `nixl_metadata` is a string, it is assumed to have come from a remote worker
# via a `RdmaMetadata` object and therefore can assumed be a
hex
-encoded, compressed
# via a `RdmaMetadata` object and therefore can assumed be a
b64
-encoded, compressed
# representation of the NIXL metadata.
if
isinstance
(
nixl_metadata
,
str
):
# Decode the hex-encoded string into bytes.
if
nixl_metadata
.
startswith
(
"b64:"
):
# Decode the b64-encoded string into bytes.
nixl_metadata
=
base64
.
b64decode
(
nixl_metadata
.
lstrip
(
"b64:"
))
else
:
# fallback for earlier versions of nixl connect
nixl_metadata
=
bytes
.
fromhex
(
nixl_metadata
)
# Decompress the NIXL metadata.
nixl_metadata
=
zlib
.
decompress
(
nixl_metadata
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment