-
Notifications
You must be signed in to change notification settings - Fork 10
Embed git commit hash into Python source #319
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Thank you! Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
Can you add a test that this is working properly?
Could we register it as |
Done @mgoin |
@robertgshaw2-neuralmagic I've added a basic test here (checks that the variable is defined): https://github.com/neuralmagic/nm-vllm/blob/simple-githash-embed/tests/test_embedded_commit.py Let me know if you want something more in-depth. |
One of the LM-EVALs failed (think it’s the same one that failed in a nightly, marlin non-determinism?):
|
I don't like the fact that we can't rely on This is also a bit specific to our build process. I thought we would integrate this more into the vllm build process natively. Something like this would work towards that: https://github.com/thuml/depyf/blob/3574bc0f12d9baad751354b19c432c822f8d321f/setup.py#L7-L16 |
@mgoin I’ve updated the PR to embed it during However, my understanding is that we want this in all builds (nightly, release, etc.), I diverged from that example slightly during |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some minor nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks perfect to me, thanks!
@@ -1,2 +1,3 @@ | |||
# UPSTREAM SYNC: take downstream | |||
__version__ = "0.5.1" | |||
__commit__ = "COMMIT_HASH_PLACEHOLDER" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I do think this is a bit long as a placeholder or dummy value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any suggestions for an appropriately short one? Maybe COMMIT_PLACEHOLDER
, or is that still long?
This PR performs a simple embed of the current git commit hash into the Python source:
__githash__
__commit__
var invllm/version.py
alongside__version__
vllm/__init__.py
is updated to (a) import__githash__
__commit__
and (b) include it in the__all__
listAs a result, you can now do the following:
Test Plan
New test added which minimally verifies that this new variable is defined to a value with a bare-minimum length.