-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Metrics] Add
--show-hidden-metrics-for-version
CLI arg
Add some infrastructure to help us deprecate and remove metrics in a less user-hostile way. Our deprecation process will now be: 1) Deprecate the metric in 0.N.0 - document the deprecation in release notes, user-facing docs, and the help text in `/metrics` 2) Hide the metric in 0.N+1.0 - users can still re-enable the metrics using `--show-hidden-metrics-for-version=0.N.0` as an escape hatch 3) Remove the metric completely in 0.N+2.0 `--show-hidden-metrics` takes a version string argument so that users cannot fall into the habit of always enabling all deprecated metrics, which would defeat the purpose. This approach is copied directly from kubernetes/kubernetes#85270 Signed-off-by: Mark McLoughlin <[email protected]>
- Loading branch information
Showing
7 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from unittest.mock import patch | ||
|
||
import pytest | ||
|
||
from vllm import version | ||
|
||
|
||
def test_version_is_defined(): | ||
assert version.__version__ is not None | ||
|
||
|
||
def test_version_tuple(): | ||
assert len(version.__version_tuple__) in (3, 4, 5) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"version_tuple, version_str, expected", | ||
[ | ||
((0, 0, "dev"), "0.0", True), | ||
((0, 0, "dev"), "foobar", True), | ||
((0, 7, 4), "0.6", True), | ||
((0, 7, 4), "0.5", False), | ||
((0, 7, 4), "0.7", False), | ||
((1, 2, 3), "1.1", True), | ||
((1, 2, 3), "1.0", False), | ||
((1, 2, 3), "1.2", False), | ||
# This won't work as expected | ||
((1, 0, 0), "1.-1", True), | ||
((1, 0, 0), "0.9", False), | ||
((1, 0, 0), "0.17", False), | ||
]) | ||
def test_prev_minor_version_was(version_tuple, version_str, expected): | ||
with patch("vllm.version.__version_tuple__", version_tuple): | ||
assert version._prev_minor_version_was(version_str) == expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters