Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JAX/version] Support adding custom version suffix. #24861

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yliu120
Copy link
Contributor

@yliu120 yliu120 commented Nov 12, 2024

This PR attempts to add a custom version suffix for JAX dev builds.

The versioning is important when people want to hash the compilation result of the JIT program. The users can use whatever local version of XLA repo and pass a version suffix constructed on their own side as part of the hash key.

This will greatly enhance the cache key especially when developers are doing dev builds based on different commits or local change.

jax/version.py Outdated
@@ -60,7 +60,8 @@ def _version_from_git_tree(base_version: str) -> str | None:
except:
return None
else:
return f"{base_version}.dev{datestring}+{commit_hash}"
version_suffix = os.environ.get("JAX_CUSTOM_VERSION_SUFFIX", "")
return f"{base_version}.dev{datestring}+{commit_hash}+{version_suffix}"
Copy link
Collaborator

@jakevdp jakevdp Nov 12, 2024

Choose a reason for hiding this comment

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

Not sure about the whole PR, but one quick observation: this looks to be incompatible with PEP 440 version specifications: the local version (everything after the first +) should only contain alphanumeric characters or periods, not another + (see https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. I change "+" -> "." and I guess from what Gemini gives me, it conforms to the standard.

https://g.co/gemini/share/4958bba9f7f0

Copy link
Collaborator

@hawkinsp hawkinsp left a comment

Choose a reason for hiding this comment

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

Can you please squash your commits? Thanks!

@yliu120
Copy link
Contributor Author

yliu120 commented Nov 16, 2024

Can you please squash your commits? Thanks!

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants