Skip to content

Commit 822759a

Browse files
authored
Merge branch 'main' into abnorm-mtp-metrics
2 parents e962167 + 6c5872e commit 822759a

93 files changed

Lines changed: 10378 additions & 1350 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

csrc/cpu/cpu_attn_impl.hpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -822,8 +822,8 @@ struct AttentionInput {
822822
logits_buffer_t *__restrict__ logits_buffer, \
823823
float *__restrict__ partial_q_buffer, float *__restrict__ max_buffer, \
824824
float *__restrict__ sum_buffer, int32_t *__restrict__ block_table, \
825-
const int32_t kv_tile_start_pos, const int32_t kv_tile_end_pos, \
826-
const int32_t kv_tile_token_num, \
825+
const int32_t kv_end_pos, const int32_t kv_tile_start_pos, \
826+
const int32_t kv_tile_end_pos, const int32_t kv_tile_token_num, \
827827
const int64_t kv_cache_num_blocks_stride, const int32_t q_head_num, \
828828
const int32_t q_token_num, const int32_t q_tile_start_pos, \
829829
const int32_t q_heads_per_kv, const int32_t block_size, \
@@ -834,7 +834,7 @@ struct AttentionInput {
834834

835835
#define CPU_ATTENTION_PARAMS \
836836
q_heads_buffer, k_head_cache_ptr, v_head_cache_ptr, logits_buffer, \
837-
partial_q_buffer, max_buffer, sum_buffer, block_table, \
837+
partial_q_buffer, max_buffer, sum_buffer, block_table, kv_end_pos, \
838838
kv_tile_start_pos, kv_tile_end_pos, kv_tile_token_num, \
839839
kv_cache_num_blocks_stride, q_head_num, q_token_num, q_tile_start_pos, \
840840
q_heads_per_kv, block_size, left_window_size, right_window_size, scale, \
@@ -917,6 +917,7 @@ class AttentionMainLoop {
917917
// - max_buffer: [MaxQHeadNumPerIteration, 1], store max logits
918918
// - sum_buffer: [MaxQHeadNumPerIteration, 1], store sum of exp
919919
// - block_table
920+
// - kv_end_pos: un-aligned end position of KV cache
920921
// - kv_tile_start_pos: start position of KV cache, aligned to
921922
// BlockSizeAlignment
922923
// - kv_tile_end_pos: end position of KV cache, aligned to
@@ -1043,7 +1044,7 @@ class AttentionMainLoop {
10431044
}
10441045

10451046
apply_mask(logits_buffer, kv_tile_token_num, q_tile_start_pos,
1046-
kv_tile_start_pos, kv_tile_end_pos, q_token_num,
1047+
kv_end_pos, kv_tile_start_pos, kv_tile_end_pos, q_token_num,
10471048
q_heads_per_kv, left_window_size, right_window_size);
10481049

10491050
// if (debug_info){
@@ -1126,7 +1127,7 @@ class AttentionMainLoop {
11261127

11271128
void apply_mask(logits_buffer_t* __restrict__ logits_buffer,
11281129
const int64_t logits_buffer_stride,
1129-
const int32_t q_tile_start_pos,
1130+
const int32_t q_tile_start_pos, const int32_t kv_end_pos,
11301131
const int32_t kv_tile_start_pos,
11311132
const int32_t kv_tile_end_pos, const int32_t q_token_num,
11321133
const int32_t q_heads_per_kv,
@@ -1154,7 +1155,7 @@ class AttentionMainLoop {
11541155
std::max(kv_tile_start_pos,
11551156
curr_token_pos + sliding_window_right + 1));
11561157
}
1157-
return pos;
1158+
return std::min(pos, kv_end_pos);
11581159
}();
11591160

11601161
int32_t left_invalid_token_num = left_kv_pos - kv_tile_start_pos;
@@ -1789,7 +1790,7 @@ class AttentionMainLoop {
17891790
attn_impl.template execute_attention<Attention>(
17901791
curr_q_heads_buffer, curr_k_cache, curr_v_cache,
17911792
logits_buffer, curr_partial_q_buffer, curr_max_buffer,
1792-
curr_sum_buffer, curr_block_table,
1793+
curr_sum_buffer, curr_block_table, kv_end_pos,
17931794
aligned_actual_kv_tile_pos_left,
17941795
aligned_actual_kv_tile_pos_right, actual_kv_token_num,
17951796
kv_cache_block_num_stride, q_tile_head_num,

csrc/cpu/generate_cpu_attn_dispatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
HEAD_DIMS_32 = [32, 64, 96, 128, 160, 192, 224, 256, 512]
1212

1313
# Head dimensions divisible by 16 but not 32 (VEC16 only)
14-
HEAD_DIMS_16 = [80, 112]
14+
HEAD_DIMS_16 = [48, 80, 112]
1515

1616
# ISA types
1717
ISA_TYPES = {
8.96 KB
Loading

docs/getting_started/installation/gpu.rocm.inc.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ If you need a different ROCm version or want to use an existing PyTorch installa
2727
--8<-- [end:set-up-using-python]
2828
--8<-- [start:pre-built-wheels]
2929

30+
!!! warning "Python 3.12 required for ROCm wheels"
31+
32+
ROCm pre-built wheels are only available for **Python 3.12**. If you are using a different Python version (e.g. 3.11 or 3.13), the installer **will silently fall back** to the CUDA wheel from PyPI, which will fail on AMD GPUs with errors like `libcudart.so: cannot open shared object file`.
33+
34+
To check your Python version: `python3 --version`
35+
36+
If you need Python 3.12, you can create an isolated environment with `uv`:
37+
38+
```bash
39+
uv venv --python 3.12 --seed --managed-python
40+
source .venv/bin/activate
41+
```
42+
3043
To install the latest version of vLLM for Python 3.12, ROCm 7.0 and `glibc >= 2.35`.
3144

3245
```bash

docs/models/pooling_models/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Our online Server provides endpoints that correspond to the offline APIs:
184184
- Corresponding to `LLM.classify`:
185185
- [Classification API](classify.md#online-serving)(`/classify`)
186186
- Corresponding to `LLM.score`:
187-
- [Score API](scoring.md#score-api)(`/score`)
187+
- [Score API](scoring.md#score-api) (`/score`, `/v1/score`)
188188
- [Cohere Rerank API](scoring.md#rerank-api) (`/rerank`, `/v1/rerank`, `/v2/rerank`)
189189
- Pooling API (`/pooling`) is similar to `LLM.encode`, being applicable to all types of pooling models.
190190

docs/models/pooling_models/scoring.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The score models is designed to compute similarity scores between two input prom
1919
- Offline APIs:
2020
- `LLM.score`
2121
- Online APIs:
22-
- [Score API](scoring.md#score-api) (`/score`)
22+
- [Score API](scoring.md#score-api) (`/score`, `/v1/score`)
2323
- [Cohere Rerank API](scoring.md#rerank-api) (`/rerank`, `/v1/rerank`, `/v2/rerank`)
2424

2525
!!! note
@@ -157,7 +157,7 @@ A code example can be found here: [examples/basic/offline_inference/score.py](..
157157

158158
### Score API
159159

160-
Our Score API (`/score`) is similar to `LLM.score`, compute similarity scores between two input prompts.
160+
Our Score API (`/score`, `/v1/score`) is similar to `LLM.score`, compute similarity scores between two input prompts.
161161

162162
#### Parameters
163163

docs/models/supported_models.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,6 @@ th {
488488
| `TeleChat2ForCausalLM` | TeleChat2 | `Tele-AI/TeleChat2-3B`, `Tele-AI/TeleChat2-7B`, `Tele-AI/TeleChat2-35B`, etc. | ✅︎ | ✅︎ |
489489
| `TeleChat3ForCausalLM` | TeleChat3 | `Tele-AI/TeleChat3-36B-Thinking`, `Tele-AI/TeleChat3-Coder-36B-Thinking`, etc. | ✅︎ | ✅︎ |
490490
| `TeleFLMForCausalLM` | TeleFLM | `CofeAI/FLM-2-52B-Instruct-2407`, `CofeAI/Tele-FLM`, etc. | ✅︎ | ✅︎ |
491-
| `XverseForCausalLM` | XVERSE | `xverse/XVERSE-7B-Chat`, `xverse/XVERSE-13B-Chat`, `xverse/XVERSE-65B-Chat`, etc. | ✅︎ | ✅︎ |
492491
| `MiniMaxM1ForCausalLM` | MiniMax-Text | `MiniMaxAI/MiniMax-M1-40k`, `MiniMaxAI/MiniMax-M1-80k`, etc. | | |
493492
| `MiniMaxText01ForCausalLM` | MiniMax-Text | `MiniMaxAI/MiniMax-Text-01`, etc. | | |
494493
| `Zamba2ForCausalLM` | Zamba2 | `Zyphra/Zamba2-7B-instruct`, `Zyphra/Zamba2-2.7B-instruct`, `Zyphra/Zamba2-1.2B-instruct`, etc. | | |

docs/serving/online_serving/README.md

Lines changed: 77 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ We currently support the following OpenAI APIs:
99
- [Completions API](./openai_compatible_server.md#completions-api) (`/v1/completions`)
1010
- Only applicable to [text generation models](../../models/generative_models.md).
1111
- *Note: `suffix` parameter is not supported.*
12-
- [Responses API](./openai_compatible_server.md#responses-api) (`/v1/responses`)
13-
- Only applicable to [text generation models](../../models/generative_models.md).
1412
- [Chat Completions API](./openai_compatible_server.md#chat-api) (`/v1/chat/completions`)
1513
- Only applicable to [text generation models](../../models/generative_models.md) with a [chat template](./openai_compatible_server.md#chat-template).
1614
- *Note: `user` parameter is ignored.*
1715
- *Note:* Setting the `parallel_tool_calls` parameter to `false` ensures vLLM only returns zero or one tool call per request. Setting it to `true` (the default) allows returning more than one tool call per request. There is no guarantee more than one tool call will be returned if this is set to `true`, as that behavior is model dependent and not all models are designed to support parallel tool calls.
16+
- [Chat Completions batch API](./openai_compatible_server.md#chat-api) (`/v1/chat/completions/batch`)
17+
- [Responses API](./openai_compatible_server.md#responses-api) (`/v1/responses`, `/v1/responses/{response_id}`, `/v1/responses/{response_id}/cancel`)
18+
- Only applicable to [text generation models](../../models/generative_models.md).
1819
- [Embeddings API](../../models/pooling_models/embed.md#openai-compatible-embeddings-api) (`/v1/embeddings`)
1920
- Only applicable to [embedding models](../../models/pooling_models/embed.md).
2021
- [Transcriptions API](./speech_to_text.md#transcriptions-api) (`/v1/audio/transcriptions`)
@@ -24,7 +25,7 @@ We currently support the following OpenAI APIs:
2425

2526
## Anthropic APIs
2627

27-
- Anthropic messages API (`/v1/messages`)
28+
- Anthropic messages API (`/v1/messages`, `/v1/messages/count_tokens`)
2829

2930
## Cohere APIs
3031

@@ -35,10 +36,6 @@ We currently support the following OpenAI APIs:
3536
- Implements [Jina AI's v1 rerank API](https://jina.ai/reranker/)
3637
- compatible with [Cohere's v1 & v2 rerank APIs](https://docs.cohere.com/v2/reference/rerank)
3738

38-
## SageMaker APIs
39-
40-
- `/invocations` - SageMaker-compatible endpoint (routes to the same inference functions as `/v1` endpoints)
41-
4239
## Pooling APIs
4340

4441
For further details on pooling models, please refer to [this page](../../models/pooling_models/README.md).
@@ -51,7 +48,7 @@ For further details on pooling models, please refer to [this page](../../models/
5148
- [OpenAI-compatible Embeddings API](../../models/pooling_models/embed.md#openai-compatible-embeddings-api) (`/v1/embeddings`)
5249
- Only applicable to [embedding models](../../models/pooling_models/embed.md).
5350
- [Scoring Usages](../../models/pooling_models/scoring.md)
54-
- [Score API](../../models/pooling_models/scoring.md#score-api) (`/score`)
51+
- [Score API](../../models/pooling_models/scoring.md#score-api) (`/score`, `/v1/score`)
5552
- [Cohere Rerank API](../../models/pooling_models/scoring.md#rerank-api) (`/rerank`, `/v1/rerank`, `/v2/rerank`)
5653
- Applicable to [score models](../../models/pooling_models/scoring.md) (cross-encoder, bi-encoder, late-interaction).
5754
- [Pooling API](../../models/pooling_models/README.md#pooling-api) (`/pooling`)
@@ -68,17 +65,6 @@ For further details on speech to text, please refer to [this page](speech_to_tex
6865
- [Realtime API](./speech_to_text.md#realtime-api) (`/v1/realtime`)
6966
- Only applicable to [Automatic Speech Recognition (ASR) models](../../models/supported_models.md#realtime-transcription).
7067

71-
## Disaggregated APIs
72-
73-
### Renderer APIs
74-
75-
For further details on renderer APIs, please refer to [this page](renderer.md).
76-
77-
- [Completions Render API](renderer.md) (`/v1/completions/render`)
78-
- Render completion requests
79-
- [Chat Completions Render API](renderer.md) (`/v1/chat/completions/render`)
80-
- Render chat completions
81-
8268
## Custom APIs
8369

8470
- [Classification API](../../models/pooling_models/classify.md#classification-api) (`/classify`)
@@ -91,14 +77,79 @@ For further details on renderer APIs, please refer to [this page](renderer.md).
9177
- Applicable to [CausalLM models](../../models/generative_models.md) (task `"generate"`).
9278
- Computes next-token probabilities for specified `label_token_ids`.
9379

94-
## Utility APIs
80+
## Instrumentator APIs
81+
82+
### Basic APIs
9583

96-
- `/tokenize` - Tokenize text
97-
- `/detokenize` - Detokenize tokens
98-
- `/health` - Health check
99-
- `/ping` - SageMaker health check
10084
- `/version` - Version information
10185
- `/load` - Server load metrics
86+
- `/v1/models` - List available models
87+
- `/health` - Health check
88+
89+
### Metrics APIs
90+
91+
For further details on metrics, please refer to [this page](../../design/metrics.md).
92+
93+
- `/metrics` - Prometheus-compatible metrics HTTP endpoint
94+
95+
### Offline API Documentation
96+
97+
The FastAPI `/docs` endpoint requires an internet connection by default. To enable offline access in air-gapped environments, use the `--enable-offline-docs` flag:
98+
99+
```bash
100+
vllm serve NousResearch/Meta-Llama-3-8B-Instruct --enable-offline-docs
101+
```
102+
103+
### LoRA dynamic loading
104+
105+
LoRA dynamic loading & unloading is enabled in the API server. This should ONLY be used for local development!
106+
107+
- `/v1/load_lora_adapter` - LoRA dynamic loading
108+
- `/v1/unload_lora_adapter` - LoRA dynamic unloading
109+
110+
### Profiling APIs
111+
112+
For further details on profiling vLLM, please refer to [this page](../../contributing/profiling.md).
113+
114+
- `/start_profile` - Start PyTorch profiler
115+
- `/stop_profile` - Stop PyTorch profiler
116+
117+
### SageMaker APIs
118+
119+
- `/ping` - SageMaker health check
120+
- `/invocations` - SageMaker-compatible endpoint (routes to the same inference functions as `/v1` endpoints)
121+
122+
## Disaggregated Everything
123+
124+
### Tokens IN <> Tokens OUT
125+
126+
- `/inference/v1/generate` - Generate completions
127+
- `/abort_requests` - Abort in-flight requests (only when `--tokens-only` is also set)
128+
129+
### Renderer APIs
130+
131+
For further details on renderer APIs, please refer to [this page](renderer.md).
132+
133+
- [Completions Render API](renderer.md) (`/v1/completions/render`)
134+
- Render completion requests
135+
- [Chat Completions Render API](renderer.md) (`/v1/chat/completions/render`)
136+
- Render chat completions
137+
138+
### Derenderer APIs
139+
140+
- `/v1/completions/derender` - Derenderer completion requests
141+
- `/v1/chat/completions/derender` - Derenderer chat completion requests
142+
143+
## Tokenize APIs
144+
145+
- `/tokenize` - Tokenize text
146+
- `/detokenize` - Detokenize tokens
147+
- `/tokenizer_info` - Get comprehensive tokenizer information including chat templates and configuration
148+
149+
## Elastic Expert Parallelism (EEP)
150+
151+
- `/scale_elastic_ep` - Trigger scaling operations
152+
- `/is_scaling_elastic_ep` - Check if scaling is in progress
102153

103154
## Server in development mode
104155

@@ -120,7 +171,9 @@ For further details on Weight Transfer, please refer to [this page](../../traini
120171
- `/resume` - Resume generation
121172
- `/is_paused` - Check if generation is paused
122173
- `/init_weight_transfer_engine` - Initialize weight transfer engine for RLHF
174+
- `/start_weight_update` - Prepares the inference engine for a weight update.
123175
- `/update_weights` - Update model weights (can alter model behavior)
176+
- `/finish_weight_update` - Finalizes the weight update
124177
- `/get_world_size` - Get distributed world size
125178

126179
### Collective RPC
@@ -189,14 +242,6 @@ the detected format, which can be one of:
189242
If the result is not what you expect, you can set the `--chat-template-content-format` CLI argument
190243
to override which format to use.
191244

192-
## Offline API Documentation
193-
194-
The FastAPI `/docs` endpoint requires an internet connection by default. To enable offline access in air-gapped environments, use the `--enable-offline-docs` flag:
195-
196-
```bash
197-
vllm serve NousResearch/Meta-Llama-3-8B-Instruct --enable-offline-docs
198-
```
199-
200245
## Ray Serve LLM
201246

202247
Ray Serve LLM enables scalable, production-grade serving of the vLLM engine. It integrates tightly with vLLM and extends it with features such as auto-scaling, load balancing, and back-pressure.

docs/serving/online_serving/openai_compatible_server.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ We currently support the following OpenAI APIs:
99
- [Completions API](#completions-api) (`/v1/completions`)
1010
- Only applicable to [text generation models](../../models/generative_models.md).
1111
- *Note: `suffix` parameter is not supported.*
12-
- [Responses API](#responses-api) (`/v1/responses`)
13-
- Only applicable to [text generation models](../../models/generative_models.md).
1412
- [Chat Completions API](#chat-api) (`/v1/chat/completions`)
1513
- Only applicable to [text generation models](../../models/generative_models.md) with a [chat template](../online_serving/README.md#chat-template).
1614
- *Note: `user` parameter is ignored.*
1715
- *Note:* Setting the `parallel_tool_calls` parameter to `false` ensures vLLM only returns zero or one tool call per request. Setting it to `true` (the default) allows returning more than one tool call per request. There is no guarantee more than one tool call will be returned if this is set to `true`, as that behavior is model dependent and not all models are designed to support parallel tool calls.
16+
- [Chat Completions batch API](#chat-api) (`/v1/chat/completions/batch`)
17+
- [Responses API](#responses-api) (`/v1/responses`, `/v1/responses/{response_id}`, `/v1/responses/{response_id}/cancel`)
18+
- Only applicable to [text generation models](../../models/generative_models.md).
1819
- [Embeddings API](../../models/pooling_models/embed.md#openai-compatible-embeddings-api) (`/v1/embeddings`)
1920
- Only applicable to [embedding models](../../models/pooling_models/embed.md).
2021
- [Transcriptions API](./speech_to_text.md#transcriptions-api) (`/v1/audio/transcriptions`)

rust/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)