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
e317414c
Unverified
Commit
e317414c
authored
Oct 10, 2025
by
Bram Wasti
Committed by
GitHub
Oct 10, 2025
Browse files
Cache the environment variable check for batch invariance (#26510)
Signed-off-by:
Bram Wasti
<
bwasti@meta.com
>
parent
949cb017
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
csrc/core/batch_invariant.hpp
csrc/core/batch_invariant.hpp
+6
-3
No files found.
csrc/core/batch_invariant.hpp
View file @
e317414c
...
...
@@ -8,9 +8,12 @@ namespace vllm {
// vllm_kernel_override_batch_invariant(); returns true
// if env VLLM_KERNEL_OVERRIDE_BATCH_INVARIANT=1
inline
bool
vllm_kernel_override_batch_invariant
()
{
std
::
string
env_key
=
"VLLM_KERNEL_OVERRIDE_BATCH_INVARIANT"
;
const
char
*
val
=
std
::
getenv
(
env_key
.
c_str
());
return
(
val
&&
std
::
atoi
(
val
)
!=
0
)
?
1
:
0
;
static
bool
cached
=
[]()
{
std
::
string
env_key
=
"VLLM_KERNEL_OVERRIDE_BATCH_INVARIANT"
;
const
char
*
val
=
std
::
getenv
(
env_key
.
c_str
());
return
(
val
&&
std
::
atoi
(
val
)
!=
0
)
?
1
:
0
;
}();
return
cached
;
}
}
// namespace vllm
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