fix(infra): simplify RTensor serialization in data proxy#1067
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors and simplifies the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request simplifies the RTensor serialization logic by centralizing the remotize call and using a unified serialize_value/deserialize_value mechanism, which is a solid improvement. The changes align well with the description, and the addition of the interaction_id setter is a good fix. I've provided a few suggestions to enhance maintainability and robustness, such as moving local imports, re-introducing a configuration warning, using a more idiomatic dictionary comprehension, and adding a type hint.
Replace dual-path serialize/deserialize logic (shard metadata vs legacy plain lists) with unified serialize_value/deserialize_value from areal.infra.rpc.serialization. RTensor.remotize() is now called directly on the data proxy side before serialization, removing the need for manual shard management in the transport layer. Key changes: - Move RTensor.remotize() call to data proxy export endpoint - Replace manual shard/legacy serialization with serialize_value - Replace manual RTensor reconstruction with deserialize_value - Add interaction_id setter to InteractionWithTokenLogpReward - Add @pytest.mark.ci to test_openclaw_online_rl
794cda3 to
ca324b1
Compare
Replace dual-path serialize/deserialize logic (shard metadata vs legacy plain lists) with unified serialize_value/deserialize_value from areal.infra.rpc.serialization. RTensor.remotize() is now called directly on the data proxy side before serialization, removing the need for manual shard management in the transport layer. Key changes: - Move RTensor.remotize() call to data proxy export endpoint - Replace manual shard/legacy serialization with serialize_value - Replace manual RTensor reconstruction with deserialize_value - Add interaction_id setter to InteractionWithTokenLogpReward - Add @pytest.mark.ci to test_openclaw_online_rl
Description
Replace dual-path serialize/deserialize logic (shard metadata vs legacy plain lists) with unified
serialize_value/deserialize_valuefromareal.infra.rpc.serialization.RTensor.remotize()is now called directly on the data proxy side before serialization, removing the need for manual shard management in the transport layer. Also addsinteraction_idsetter toInteractionWithTokenLogpRewardfor proper ID preservation during deserialization.Related Issue
N/A
Type of Change
Checklist
jb build docs/gemini review)Breaking Change Details (if applicable):
N/A
Additional Context
Files changed:
areal/experimental/inference_service/data_proxy/app.py: Move RTensor.remotize() to export endpoint, remove node_addr pass-throughareal/experimental/openai/proxy/server.py: Replace manual shard/legacy serialization with serialize_value/deserialize_valueareal/experimental/openai/types.py: Add _interaction_id field and settertests/test_examples.py: Add @pytest.mark.ci to test_openclaw_online_rl