third_party/vllm/ now tracked in git for direct patch management.
Based on vLLM v0.18.1 release with one patch applied:
vllm/v1/core/sched/scheduler.py:
Replace fatal assert with graceful skip when KV transfer callback
arrives for an already-aborted request during PD disaggregated serving.
Future vLLM modifications should be made directly in third_party/vllm/
and committed normally. The patches/ directory is kept as documentation
of what changed from upstream.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
29 lines
785 B
C++
29 lines
785 B
C++
#pragma once
|
|
|
|
#include <climits>
|
|
#include <iostream>
|
|
|
|
inline constexpr uint32_t next_pow_2(uint32_t const num) {
|
|
if (num <= 1) return num;
|
|
return 1 << (CHAR_BIT * sizeof(num) - __builtin_clz(num - 1));
|
|
}
|
|
|
|
template <typename A, typename B>
|
|
static inline constexpr auto div_ceil(A a, B b) {
|
|
return (a + b - 1) / b;
|
|
}
|
|
|
|
// Round a down to the next multiple of b. The caller is responsible for making
|
|
// sure that b is non-zero
|
|
template <typename T>
|
|
inline constexpr T round_to_previous_multiple_of(T a, T b) {
|
|
return a % b == 0 ? a : (a / b) * b;
|
|
}
|
|
|
|
// Round a up to the next multiple of b. The caller is responsible for making
|
|
// sure that b is non-zero
|
|
template <typename T>
|
|
inline constexpr T round_to_next_multiple_of(T a, T b) {
|
|
return a % b == 0 ? a : ((a / b) + 1) * b;
|
|
}
|