We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 614934f commit 4792935Copy full SHA for 4792935
csrc/core/batch_invariant.hpp
@@ -8,9 +8,12 @@ namespace vllm {
8
// vllm_kernel_override_batch_invariant(); returns true
9
// if env VLLM_KERNEL_OVERRIDE_BATCH_INVARIANT=1
10
inline bool vllm_kernel_override_batch_invariant() {
11
- std::string env_key = "VLLM_KERNEL_OVERRIDE_BATCH_INVARIANT";
12
- const char* val = std::getenv(env_key.c_str());
13
- 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());
14
+ return (val && std::atoi(val) != 0) ? 1 : 0;
15
+ }();
16
+ return cached;
17
}
18
19
} // namespace vllm
0 commit comments