0
Fork 0
mirror of https://github.com/zml/zml.git synced 2026-11-16 19:11:09 +00:00

Compare commits

...

1 commit

Author SHA1 Message Date
Benjamin Rabier
c81078daf1 zml/profiling: preserve binary profiles and validate provider sentinels
PJRT CollectData returns serialized binary data with an explicit byte count.
Unconditionally trimming a trailing NUL can truncate a valid XSpace field,
such as an explicitly encoded zero-valued plane ID, before trace export.
However, XLA's plugin implementation also returns a buffer with one extra
NUL byte, so simply preserving the buffer requires parser compatibility.

Copy the exact returned bytes in both the direct-buffer and two-pass PJRT
paths. At the XSpace boundary, parse the complete buffer first and retry
without one trailing NUL only when the complete buffer fails to parse and
the shortened message is valid. Reject oversized and nonempty null inputs
before calling protobuf, and stop any active local host trace session on
parse failure so that subsequent profiling can start normally.
2026-11-11 13:22:52 +01:00
5 changed files with 185 additions and 20 deletions