Skip to content

Commit bd41903

Browse files
authored
Merge branch 'main' into mcv-binary-cache
2 parents 913e0fc + d824e71 commit bd41903

File tree

78 files changed

+916
-337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+916
-337
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ repos:
1919
additional_dependencies:
2020
- tomli
2121
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
22-
rev: v9.23.0
22+
rev: v9.24.0
2323
hooks:
2424
- id: commitlint
2525
stages: [commit-msg]
2626
- repo: https://github.com/adrienverge/yamllint
27-
rev: v1.37.1
27+
rev: v1.38.0
2828
hooks:
2929
- id: yamllint
3030
exclude: ^mcv/vendor/.*|^mcv/_output/.*|^venv/.*|^mcv/logo/.*|^mcv/example/vllm-cache/.*|^mcv/example/.*-binary-cache/.*

mcm/model_cache_manager/data/kernel_validator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
log = logging.getLogger(__name__)
1717

1818

19-
class KernelTarget(BaseModel):
19+
class KernelTarget(BaseModel): # pylint: disable=too-few-public-methods
2020
"""Validation model for the 'target' field of kernel metadata."""
2121

2222
backend: str = ""
2323
arch: int | str = 0
2424
warp_size: int = 0
2525

2626

27-
class KernelMetadata(BaseModel):
27+
class KernelMetadata(BaseModel): # pylint: disable=too-few-public-methods
2828
"""
2929
Pydantic model for validating kernel metadata.
3030

mcm/model_cache_manager/tests/utils/test_cache_mode_detection.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,23 @@ def test_detect_vllm_structure_no_rank_dirs(self):
244244
mode = detect_cache_mode(cache_dir)
245245
self.assertEqual(mode, MODE_TRITON)
246246

247+
def test_detect_vllm_binary_cache_structure(self):
248+
"""Test detection of new vLLM cache structure with binary artifacts."""
249+
# Binary artifacts are files (not directories) named artifact_compile_range_*
250+
vllm_dir = self.temp_dir / "vllm_binary"
251+
torch_compile = vllm_dir / "torch_compile_cache"
252+
hash_dir = torch_compile / "some_vllm_hash"
253+
rank_dir = hash_dir / "rank_0_0"
254+
backbone_dir = rank_dir / "backbone"
255+
backbone_dir.mkdir(parents=True)
256+
257+
# Create a binary artifact file (not a directory)
258+
binary_artifact = backbone_dir / "artifact_compile_range_0"
259+
binary_artifact.write_bytes(b"\x00binary data")
260+
261+
mode = detect_cache_mode(vllm_dir)
262+
self.assertEqual(mode, MODE_VLLM)
263+
247264
def test_detect_mixed_legacy_and_triton_vllm_takes_precedence(self):
248265
"""Test detection when both vllm-legacy and triton structures exist."""
249266
cache_dir = self.temp_dir / "mixed_cache"

mcm/model_cache_manager/utils/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,12 @@ def iter_artifact_compile_range_dirs(backbone_dir: Path):
198198

199199

200200
def _has_artifact_compile_range_with_triton(backbone_dir: Path) -> bool:
201-
"""Check if backbone directory has artifact_compile_range subdirectories with triton."""
201+
"""Check if backbone directory has artifact_compile_range artifacts (unpacked or binary)."""
202202
for artifact_dir in iter_artifact_compile_range_dirs(backbone_dir):
203+
# Binary artifact (file) — contains packed triton data
204+
if artifact_dir.is_file():
205+
return True
206+
# Unpacked artifact (directory) — check for triton subdirectory
203207
triton_dir = artifact_dir / "triton"
204208
if triton_dir.exists():
205209
return True

mcm/pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@ authors = [{name = "Alessandro Sangiorgi", email = "asangior@redhat.com"
1010
requires-python = ">=3.9"
1111

1212
dependencies = [
13-
"triton",
1413
"rich>=13.7",
1514
"typer[all]",
1615
"structlog",
1716
"pydantic>=2",
1817
"pydantic-settings>=2",
1918
"sqlalchemy>=2.0.40",
19+
"vllm==0.15.1",
2020
]
2121

2222
[project.scripts]
2323
mcm = "model_cache_manager.cli.main:run"
2424

25+
[tool.pylint."messages_control"]
26+
disable = ["import-error"]
27+
2528
[tool.setuptools]
2629
package-dir = {"" = "."}
2730

mcm/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
typer>=0.9.0
1+
typer[all]
22
rich>=13.7
33
pydantic>=2.0.0
44
pydantic-settings>=2.0.0
5-
structlog>=23.0.0
5+
structlog
66
sqlalchemy>=2.0.40
77
pytest>=7.0.0
8-
vllm
8+
vllm==0.15.1

mcv/go.mod

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/containers/buildah v1.42.1
88
github.com/containers/podman/v5 v5.7.0
99
github.com/docker/docker v28.5.2+incompatible
10-
github.com/google/go-containerregistry v0.20.6
10+
github.com/google/go-containerregistry v0.20.7
1111
github.com/jaypipes/ghw v0.17.0
1212
github.com/jaypipes/pcidb v1.0.1
1313
github.com/pkg/errors v0.9.1
@@ -52,7 +52,7 @@ require (
5252
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
5353
github.com/disiqueira/gotree/v3 v3.0.2 // indirect
5454
github.com/distribution/reference v0.6.0 // indirect
55-
github.com/docker/cli v28.5.2+incompatible // indirect
55+
github.com/docker/cli v29.0.3+incompatible // indirect
5656
github.com/docker/distribution v2.8.3+incompatible // indirect
5757
github.com/docker/docker-credential-helpers v0.9.4 // indirect
5858
github.com/docker/go-connections v0.6.0 // indirect
@@ -114,9 +114,9 @@ require (
114114
github.com/proglottis/gpgme v0.1.5 // indirect
115115
github.com/seccomp/libseccomp-golang v0.11.1 // indirect
116116
github.com/secure-systems-lab/go-securesystemslib v0.9.1 // indirect
117-
github.com/sigstore/fulcio v1.8.3 // indirect
117+
github.com/sigstore/fulcio v1.8.5 // indirect
118118
github.com/sigstore/protobuf-specs v0.5.0 // indirect
119-
github.com/sigstore/sigstore v1.10.0 // indirect
119+
github.com/sigstore/sigstore v1.10.3 // indirect
120120
github.com/skeema/knownhosts v1.3.2 // indirect
121121
github.com/smallstep/pkcs7 v0.1.1 // indirect
122122
github.com/spf13/pflag v1.0.10 // indirect
@@ -135,17 +135,18 @@ require (
135135
go.opentelemetry.io/otel/metric v1.38.0 // indirect
136136
go.opentelemetry.io/otel/trace v1.38.0 // indirect
137137
go.yaml.in/yaml/v2 v2.4.3 // indirect
138-
golang.org/x/crypto v0.45.0 // indirect
139-
golang.org/x/mod v0.29.0 // indirect
140-
golang.org/x/net v0.47.0 // indirect
141-
golang.org/x/sync v0.18.0 // indirect
142-
golang.org/x/sys v0.38.0 // indirect
143-
golang.org/x/term v0.37.0 // indirect
144-
golang.org/x/text v0.31.0 // indirect
145-
google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8 // indirect
146-
google.golang.org/genproto/googleapis/rpc v0.0.0-20251103181224-f26f9409b101 // indirect
147-
google.golang.org/grpc v1.77.0 // indirect
148-
google.golang.org/protobuf v1.36.10 // indirect
138+
golang.org/x/crypto v0.46.0 // indirect
139+
golang.org/x/mod v0.31.0 // indirect
140+
golang.org/x/net v0.48.0 // indirect
141+
golang.org/x/sync v0.19.0 // indirect
142+
golang.org/x/sys v0.39.0 // indirect
143+
golang.org/x/term v0.38.0 // indirect
144+
golang.org/x/text v0.32.0 // indirect
145+
golang.org/x/tools v0.40.0 // indirect
146+
google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b // indirect
147+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect
148+
google.golang.org/grpc v1.78.0 // indirect
149+
google.golang.org/protobuf v1.36.11 // indirect
149150
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
150151
gopkg.in/yaml.v3 v3.0.1 // indirect
151152
howett.net/plist v1.0.0 // indirect

0 commit comments

Comments
 (0)