Read code changes as Git diffs. Identifying strings are masked; binary files are listed by their full relative names.
verl · 1 changed files
Base commit: 0b2151ec61de5d99e0811b01c09e43a99a23e69d
diff --git a/verl/workers/rollout/vllm_rollout/vllm_async_server.py b/verl/workers/rollout/vllm_rollout/vllm_async_server.pyindex 962cf1fb5579f4dd7e4d857ac447544c532ec1ab..0bab4c70459ceba0c7fa49eb721101e60589d794 100644--- a/verl/workers/rollout/vllm_rollout/vllm_async_server.py+++ b/verl/workers/rollout/vllm_rollout/vllm_async_server.py@@ -429,6 +429,73 @@ class vLLMHttpServer: self.engine = engine_client self._server_port, self._server_task = await run_uvicorn(app, args, self._server_address)+ await self._warmup_first_use_kernels(engine_client)++ async def _warmup_first_use_kernels(self, engine_client: AsyncLLM):+ """Trigger one small mixed-batch generation at server startup.++ The first real generation batch pays one-time costs (triton kernel+ JIT for the hybrid short-conv decode path, sampler kernels, lazy+ device-module loads). Running a tiny warmup batch here moves those+ costs out of the measured rollout window. This is best-effort only:+ it never changes workload results, and any failure is logged and+ ignored.+ """+ try:+ vocab_size = len(self.model_config.tokenizer)+ base_prompt = [(97 + 131 * i) % vocab_size for i in range(40)]+ requests = []+ for index in range(4):+ sampling_params = SamplingParams(+ temperature=0.7,+ top_p=0.8,+ top_k=20,+ seed=900 + index,+ max_tokens=24,+ logprobs=0,+ )+ prompt = TokensPrompt(+ prompt_token_ids=[(token + 7 * index) % vocab_size for token in base_prompt]+ )+ requests.append(+ self._drain_warmup_request(+ engine_client, prompt, sampling_params, f"verl-warmup-sample-{index}"+ )+ )+ for index in range(2):+ sampling_params = SamplingParams(+ temperature=0.0,+ seed=990 + index,+ max_tokens=16,+ logprobs=0,+ ignore_eos=True,+ )+ prompt = TokensPrompt(+ prompt_token_ids=[(token + 13 * index) % vocab_size for token in base_prompt]+ )+ requests.append(+ self._drain_warmup_request(+ engine_client, prompt, sampling_params, f"verl-warmup-greedy-{index}"+ )+ )+ await asyncio.gather(*requests)+ logger.info("Rollout first-use kernel warmup finished")+ except Exception:+ logger.warning("Rollout first-use kernel warmup failed; continuing without it", exc_info=True)++ @staticmethod+ async def _drain_warmup_request(+ engine_client: AsyncLLM,+ prompt: TokensPrompt,+ sampling_params: SamplingParams,+ request_id: str,+ ):+ async for _ in engine_client.generate(+ prompt=prompt,+ sampling_params=sampling_params,+ request_id=request_id,+ ):+ pass async def run_headless(self, args: argparse.Namespace): """Run headless server in a separate thread."""
vllm_ascend · 1 changed files
Base commit: f649187194c44d86415d1ddfa49359e824932c9a
diff --git a/vllm_ascend/patch/platform/patch_mamba_config.py b/vllm_ascend/patch/platform/patch_mamba_config.pyindex 775e54743769e9f48de6fa316f05a48816b79f7d..a434fe6ba30993e44f57e9a9f600050fd3027023 100644--- a/vllm_ascend/patch/platform/patch_mamba_config.py+++ b/vllm_ascend/patch/platform/patch_mamba_config.py@@ -56,7 +56,7 @@ def verify_and_update_config(cls, vllm_config) -> None: # all cache tensors contiguous, so we align the page size of ssm_block # and single attn_block attn_block_size = kernel_block_size * cdiv(ssm_block_page_size, kernel_block_size * attn_single_token_k_page_size)- assert attn_single_token_k_page_size * attn_block_size == ssm_block_page_size, (+ assert attn_single_token_k_page_size * attn_block_size >= ssm_block_page_size, ( "Cannot align ssm_page_size and attn_page_size." )