Skip to content

Conversation

@gnecula
Copy link
Collaborator

@gnecula gnecula commented Dec 10, 2025

The serialization version v6 was introduced in #33597.
I have tested these manually for forward compatibility by
cherry-picking this PR on a version of the code before v6.

This is in preparation for the upcoming serialization version 6 (jax-ml#33597).
The serialization version v6 was introduced in jax-ml#33597.
I have tested these manually for forward compatibility by
cherry-picking this PR on a version of the code before v6.
@gnecula gnecula requested a review from mwhittaker December 10, 2025 11:32
@gnecula gnecula self-assigned this Dec 10, 2025
@gnecula gnecula added the pull ready Ready for copybara import and testing label Dec 10, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gnecula, 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 focuses on enhancing the robustness of JAX's export serialization by adding comprehensive backwards compatibility tests for serialization version 6. It ensures that exported JAX functions, particularly those dealing with memory space and sharding configurations, can be reliably deserialized and executed across different versions. The changes involve introducing new test data and refining the testing utilities to support these validations.

Highlights

  • New Backwards Compatibility Test Data: Added export_with_memory_space.py to store serialization data for JAX's export feature, specifically for functions involving memory space.
  • Updated Existing Test Data: Existing test data files (export_with_specified_sharding.py, export_with_unspecified_sharding.py) were updated to include serialization data for version 6, ensuring compatibility with the latest serialization format.
  • Enhanced Serialization Test Utility: The export_and_serialize helper function now supports specifying target platforms during export and generates cleaner output filenames for test data.
  • New Test Case for Memory Space: A new test test_with_memory_space was introduced to validate the correct serialization and deserialization of JAX functions that utilize specific memory spaces (e.g., "pinned_host").
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds backward compatibility tests for serialization version 6. The changes include a new test for memory_space serialization, along with the corresponding test data for versions 5 and 6. Existing test data files for sharding are also updated with version 6 data. The test helper export_and_serialize is updated to support platforms and to generate cleaner filenames for new test data. The changes are well-structured, correct, and follow existing patterns in the codebase. I have no specific comments for changes.

Copy link
Collaborator

@mwhittaker mwhittaker left a comment

Choose a reason for hiding this comment

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

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kokoro:force-run pull ready Ready for copybara import and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants