diff --git a/.buildkite/intel_jobs/misc_intel.yaml b/.buildkite/intel_jobs/misc_intel.yaml index ec3d34c20f..9f3aeea7ce 100644 --- a/.buildkite/intel_jobs/misc_intel.yaml +++ b/.buildkite/intel_jobs/misc_intel.yaml @@ -76,6 +76,26 @@ steps: pytest -v -s v1/sample/test_logprobs.py && pytest -v -s v1/sample/test_logprobs_e2e.py' +- label: Basic Models Tests (Initialization) + timeout_in_minutes: 60 + device: intel_gpu + no_plugin: true + working_dir: "." + env: + REGISTRY: "public.ecr.aws/q9t5s3a7" + REPO: "vllm-ci-test-repo" + VLLM_TEST_DEVICE: "xpu" + source_file_dependencies: + - vllm/ + - tests/models/test_initialization.py + - tests/models/registry.py + commands: + - >- + bash .buildkite/scripts/hardware_ci/run-intel-test.sh + 'export VLLM_XPU_FUSED_MOE_USE_REF=1 && + cd tests && + pytest -v -s models/test_initialization.py::test_can_initialize_large_subset[Eagle3MiniMaxM2ForCausalLM]' + - label: XPU CPU Offload timeout_in_minutes: 60 device: intel_gpu diff --git a/vllm/model_executor/models/llama_eagle3.py b/vllm/model_executor/models/llama_eagle3.py index 8ce86c7780..2d859bd491 100644 --- a/vllm/model_executor/models/llama_eagle3.py +++ b/vllm/model_executor/models/llama_eagle3.py @@ -233,7 +233,10 @@ class LlamaModel(nn.Module): ) -> tuple[torch.Tensor, torch.Tensor]: if input_embeds is None: input_embeds = self.embed_input_ids(input_ids) - assert hidden_states.shape[-1] == input_embeds.shape[-1] + torch._assert( + hidden_states.shape[-1] == input_embeds.shape[-1], + "hidden_states and input_embeds must have the same last dimension", + ) residual = None for layer in self.layers: diff --git a/vllm/v1/spec_decode/llm_base_proposer.py b/vllm/v1/spec_decode/llm_base_proposer.py index 4d27e308e8..756c5f3b37 100644 --- a/vllm/v1/spec_decode/llm_base_proposer.py +++ b/vllm/v1/spec_decode/llm_base_proposer.py @@ -1468,6 +1468,26 @@ class SpecDecodeBaseProposer: "Sharing target model embedding weights with the draft model." ) + if share_embeddings: + draft_embed = self.model.model.embed_tokens + # Only share when both models use the same embedding width. + # Guard with isinstance so non-Tensor weights (e.g. in tests) + # are not affected — mirrors the weight-equality check above. + if isinstance(target_embed_tokens.weight, torch.Tensor) and isinstance( + draft_embed.weight, torch.Tensor + ): + target_dim = target_embed_tokens.weight.shape[-1] + draft_dim = draft_embed.weight.shape[-1] + if target_dim != draft_dim: + share_embeddings = False + logger.info( + "Target embedding dim (%d) differs from draft " + "embedding dim (%d). Keeping separate embedding " + "weights.", + target_dim, + draft_dim, + ) + if share_embeddings: if hasattr(self.model.model, "embed_tokens"): del self.model.model.embed_tokens