main
hpp 18 lines 414 Bytes
Raw
1 #pragma once
2 #include <cstdlib>
3 #include <string>
4
5 namespace vllm {
6
7 // vllm_is_batch_invariant(); returns true
8 // if env VLLM_BATCH_INVARIANT=1
9 inline bool vllm_is_batch_invariant() {
10 static bool cached = []() {
11 std::string env_key = "VLLM_BATCH_INVARIANT";
12 const char* val = std::getenv(env_key.c_str());
13 return (val && std::atoi(val) != 0) ? 1 : 0;
14 }();
15 return cached;
16 }
17
18 } // namespace vllm