Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
fe178710
Unverified
Commit
fe178710
authored
Dec 11, 2025
by
Zhengxu Chen
Committed by
GitHub
Dec 12, 2025
Browse files
[compile] Parse compile range cache keys as Range during cache loading. (#30516)
Signed-off-by:
zhxchen17
<
zhxchen17@fb.com
>
parent
783644e4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
vllm/compilation/backends.py
vllm/compilation/backends.py
+19
-1
No files found.
vllm/compilation/backends.py
View file @
fe178710
...
...
@@ -141,7 +141,25 @@ class CompilerManager:
# we use ast.literal_eval to parse the data
# because it is a safe way to parse Python literals.
# do not use eval(), it is unsafe.
self
.
cache
=
ast
.
literal_eval
(
f
.
read
())
cache
=
ast
.
literal_eval
(
f
.
read
())
def
check_type
(
value
,
ty
):
if
not
isinstance
(
value
,
ty
):
raise
TypeError
(
f
"Expected
{
ty
}
but got
{
type
(
value
)
}
for
{
value
}
"
)
def
parse_key
(
key
:
Any
)
->
tuple
[
Range
,
int
,
str
]:
range_tuple
,
graph_index
,
compiler_name
=
key
check_type
(
graph_index
,
int
)
check_type
(
compiler_name
,
str
)
if
isinstance
(
range_tuple
,
tuple
):
start
,
end
=
range_tuple
check_type
(
start
,
int
)
check_type
(
end
,
int
)
range_tuple
=
Range
(
start
=
start
,
end
=
end
)
check_type
(
range_tuple
,
Range
)
return
range_tuple
,
graph_index
,
compiler_name
self
.
cache
=
{
parse_key
(
key
):
value
for
key
,
value
in
cache
.
items
()}
self
.
compiler
.
initialize_cache
(
cache_dir
=
cache_dir
,
disable_cache
=
disable_cache
,
prefix
=
prefix
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment