Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Model] Add Gemma 2 #5908

Merged
merged 6 commits into from
Jun 27, 2024
Merged

[Model] Add Gemma 2 #5908

merged 6 commits into from
Jun 27, 2024

Conversation

WoosukKwon
Copy link
Collaborator

@WoosukKwon WoosukKwon commented Jun 27, 2024

This PR adds Gemma 2, a new family of open LLMs from Google.

Two major issues to note:

  1. Attention logit soft-capping: Gemma 2 models soft-cap the attention logits. This requires changes to all the attention kernels vLLM is using, so this PR removes soft-capping as a temporary workaround. While this makes the model different from the original implementation, it does not significantly affect the model's generation capability.
  2. Sliding window attention: Gemma 2 uses sliding window attention for every other layer. vLLM currently ignores it and uses global attention for all layers. This might affect the model's behavior when the context length is larger than the sliding window size (4K). Therefore, this PR temporarily truncates the model's maximum length to 4K.

These issues will also be explicitly mentioned in warning messages.

@WoosukKwon WoosukKwon added the new model Requests to new models label Jun 27, 2024
@WoosukKwon
Copy link
Collaborator Author

WoosukKwon commented Jun 27, 2024

Currently blocked by transformers 4.42 release.

@robertgshaw2-neuralmagic
Copy link
Sponsor Collaborator

robertgshaw2-neuralmagic commented Jun 27, 2024

@WoosukKwon running with --disable-sliding-window should resolve this SLA issue. We could also set this as the default if gemma2 arch is detected

@WoosukKwon
Copy link
Collaborator Author

@robertgshaw2-neuralmagic Yes I did a similar thing in config.py Could you please take a look?

@robertgshaw2-neuralmagic
Copy link
Sponsor Collaborator

@robertgshaw2-neuralmagic Yes I did a similar thing in config.py Could you please take a look?

The only issue with what you have done is that model_max_len will get set tomax_position_embedding rather than sliding_window_size

If you set disable_sliding_window=True in

self.disable_sliding_window = disable_sliding_window
, then you all of the logic associated with selecting the max_seq_len will be capped at sliding window size

If we do not want this as the default behavior, we could instead let the user know about this flag in the print_warning_once

vllm/config.py Show resolved Hide resolved
@WoosukKwon
Copy link
Collaborator Author

@robertgshaw2-neuralmagic Thanks for letting me know! Update the PR. PTAL.

"layer, vLLM currently ignores it and uses global attention "
"for all layers. This might affect the model's behavior when "
"the context length is larger than the sliding window size "
f"({self.hf_text_config.sliding_window}).")
Copy link
Sponsor Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good.

I think this warning should be updated to say something like Gemma 2 uses sliding window attention for every odd layer, which is not supported by vllm. Disabling sliding window and capping max length to sliding_window_size

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robertgshaw2-neuralmagic Oh maybe I misunderstood the change here. My intention was to enable the full (8K) context length with global attention for all layers.

Copy link
Sponsor Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay sorry for the confusion the way you had it before will do this :)

Setting disable_sliding_window=True will cap to sliding_window_size

Copy link
Sponsor Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think either option is reasonable.

  • For capping at 4k, its more conservative re: model accuracy
  • For capping at 8k, its less conservative re: model accuracy

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robertgshaw2-neuralmagic Hmm... OK let's use 4K context length for now and see if people want 8K content length despite the difference from the original model.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robertgshaw2-neuralmagic Updated the warning msg. PTAL!

Copy link
Sponsor Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

self.weight = nn.Parameter(torch.zeros(hidden_size))
self.variance_epsilon = eps

def forward_native(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should try decorating this with @torch.compile, similar to what we do in Command R

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was thinking about it or writing a CUDA kernel. Let's discuss this in another PR?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good -- agree it should be in a different PR :)

@WoosukKwon WoosukKwon merged commit 79c92c7 into main Jun 27, 2024
18 of 20 checks passed
@WoosukKwon WoosukKwon deleted the woosuk-gemma2 branch June 27, 2024 20:33
@zifeitong
Copy link
Contributor

Attention logit soft-capping: Gemma 2 models soft-cap the attention logits. This requires changes to all the attention kernels vLLM is using, so this PR removes soft-capping as a temporary workaround. While this makes the model different from the original implementation, it does not significantly affect the model's generation capability.

For the 27b model, logit soft-capping seems to be very important: huggingface/transformers#31698. 9b model works fine without it.

prashantgupta24 pushed a commit to prashantgupta24/vllm-project that referenced this pull request Jun 28, 2024
robertgshaw2-neuralmagic pushed a commit to neuralmagic/nm-vllm that referenced this pull request Jul 1, 2024
@Hi-archers
Copy link

@zifeitong Thanks for letting us know! We are planning to use the latest version of FlashInfer to include the soft-capping. Please stay tuned.

Would also like to report that install from source of current vllm with gemma2 support is working fine for gemma-2-9b and completely failing for gemma-2-27b. Exact same code, same prompts, etc and it all is fitting on single H100. Gemma-2-27B only outputs 0 tokens, while Gemma-2-9B outputs as expected. Working with the base models downloaded from huggingface repos.

I obtained results similar to @Rallio67 . When using vLLM on A800 with bf16 for generation, Gemma2-9B generates normally, but sometimes Gemma2-27B cannot complete the generation properly and continuously produces a large number of meaningless words.

prashantgupta24 pushed a commit to opendatahub-io/vllm that referenced this pull request Jul 1, 2024
prashantgupta24 pushed a commit to opendatahub-io/vllm that referenced this pull request Jul 1, 2024
Gaivoronsky

This comment was marked as duplicate.

kzawora-intel added a commit to HabanaAI/vllm-fork that referenced this pull request Jul 2, 2024
* [Hardware][Intel] Optimize CPU backend and add more performance tips (vllm-project#4971)

Co-authored-by: Jianan Gu <[email protected]>

* [Docs] Add 4th meetup slides (vllm-project#5509)

* [Misc] Add vLLM version getter to utils (vllm-project#5098)

* [CI/Build] Simplify OpenAI server setup in tests (vllm-project#5100)

* [Doc] Update LLaVA docs (vllm-project#5437)

Co-authored-by: Roger Wang <[email protected]>

* [Kernel] Factor out epilogues from cutlass kernels (vllm-project#5391)

Co-authored-by: Michael Goin <[email protected]>
Co-authored-by: youkaichao <[email protected]>
Co-authored-by: zifeitong <[email protected]>
Co-authored-by: Robert Shaw <[email protected]>

* [MISC] Remove FP8 warning (vllm-project#5472)

Co-authored-by: Philipp Moritz <[email protected]>

* Seperate dev requirements into lint and test (vllm-project#5474)

* Revert "[Core] Remove unnecessary copies in flash attn backend" (vllm-project#5478)

* [misc] fix format.sh (vllm-project#5511)

* [CI/Build] Disable test_fp8.py (vllm-project#5508)

* [Kernel] Disable CUTLASS kernels for fp8 (vllm-project#5505)

* Add `cuda_device_count_stateless` (vllm-project#5473)

* [Hardware][Intel] Support CPU inference with AVX2 ISA (vllm-project#5452)

* [Misc] Fix arg names in quantizer script (vllm-project#5507)

* bump version to v0.5.0.post1 (vllm-project#5522)

* [CI/Build][Misc] Add CI that benchmarks vllm performance on those PRs with `perf-benchmarks` label (vllm-project#5073)

Co-authored-by: simon-mo <[email protected]>

* [CI/Build] Disable LLaVA-NeXT CPU test (vllm-project#5529)

* [Kernel] Fix CUTLASS 3.x custom broadcast load epilogue (vllm-project#5516)

* [Misc] Fix arg names (vllm-project#5524)

* [ Misc ] Rs/compressed tensors cleanup (vllm-project#5432)

Co-authored-by: mgoin <[email protected]>
Co-authored-by: Dipika Sikka <[email protected]>

* [Kernel] Suppress mma.sp warning on CUDA 12.5 and later (vllm-project#5401)

* [mis] fix flaky test of test_cuda_device_count_stateless (vllm-project#5546)

* [Core] Remove duplicate processing in async engine (vllm-project#5525)

* [misc][distributed] fix benign error in `is_in_the_same_node` (vllm-project#5512)

* [Docs] Add ZhenFund as a Sponsor (vllm-project#5548)

* [Doc] Update documentation on Tensorizer (vllm-project#5471)

* [Bugfix] Enable loading FP8 checkpoints for gpt_bigcode models  (vllm-project#5460)

Signed-off-by: Thomas Parnell <[email protected]>

* [Bugfix] Fix typo in Pallas backend (vllm-project#5558)

* [Core][Distributed] improve p2p cache generation (vllm-project#5528)

* Add ccache to amd (vllm-project#5555)

* [Core][Bugfix]: fix prefix caching for blockv2 (vllm-project#5364)

Signed-off-by: Lei Wen <[email protected]>
Co-authored-by: Lei Wen <[email protected]>

* [mypy] Enable type checking for test directory (vllm-project#5017)

* [CI/Build] Test both text and token IDs in batched OpenAI Completions API (vllm-project#5568)

* [misc] Do not allow to use lora with chunked prefill. (vllm-project#5538)

Co-authored-by: Cyrus Leung <[email protected]>

* add gptq_marlin test for bug report vllm-project#5088 (vllm-project#5145)

* [BugFix] Don't start a Ray cluster when not using Ray (vllm-project#5570)

* [Fix] Correct OpenAI batch response format (vllm-project#5554)

* Add basic correctness 2 GPU tests to 4 GPU pipeline (vllm-project#5518)

* [CI][BugFix] Flip is_quant_method_supported condition (vllm-project#5577)

* [build][misc] limit numpy version (vllm-project#5582)

* [Doc] add debugging tips for crash and multi-node debugging (vllm-project#5581)

* Fix w8a8 benchmark and add Llama-3-8B (vllm-project#5562)

* [Model] Rename Phi3 rope scaling type (vllm-project#5595)

* Correct alignment in the seq_len diagram. (vllm-project#5592)

Co-authored-by: Liqian Chen <[email protected]>

* [Kernel] `compressed-tensors` marlin 24 support (vllm-project#5435)

* [Misc] use AutoTokenizer for benchmark serving when vLLM not installed (vllm-project#5588)

* [Hardware][Intel GPU] Add Intel GPU(XPU) inference backend (vllm-project#3814)

Co-authored-by: Jiang Li <[email protected]>
Co-authored-by: Abhilash Majumder <[email protected]>
Co-authored-by: Abhilash Majumder <[email protected]>

* [CI/BUILD] Support non-AVX512 vLLM building and testing (vllm-project#5574)

* [CI] the readability of benchmarking and prepare for dashboard (vllm-project#5571)

[CI] Improve the readability of performance benchmarking results and prepare for upcoming performance dashboard (vllm-project#5571)

* [bugfix][distributed] fix 16 gpus local rank arrangement (vllm-project#5604)

* [Optimization] use a pool to reuse LogicalTokenBlock.token_ids (vllm-project#5584)

* [Bugfix] Fix KV head calculation for MPT models when using GQA (vllm-project#5142)

* [Fix] Use utf-8 encoding in entrypoints/openai/run_batch.py (vllm-project#5606)

* [Speculative Decoding 1/2 ] Add typical acceptance sampling as one of the sampling techniques in the verifier (vllm-project#5131)

* [Model] Initialize Phi-3-vision support (vllm-project#4986)

* [Kernel] Add punica dimensions for Granite 13b (vllm-project#5559)

Signed-off-by: Joe Runde <[email protected]>

* [misc][typo] fix typo (vllm-project#5620)

* [Misc] Fix typo (vllm-project#5618)

* [CI] Avoid naming different metrics with the same name in performance benchmark (vllm-project#5615)

* [bugfix][distributed] improve p2p capability test (vllm-project#5612)

[bugfix][distributed] do not error if two processes do not agree on p2p capability (vllm-project#5612)

* [Misc] Remove import from transformers logging (vllm-project#5625)

* [CI/Build][Misc] Update Pytest Marker for VLMs (vllm-project#5623)

* [ci] Deprecate original CI template (vllm-project#5624)

Signed-off-by: kevin <[email protected]>

* [Misc] Add OpenTelemetry support (vllm-project#4687)

This PR adds basic support for OpenTelemetry distributed tracing.
It includes changes to enable tracing functionality and improve monitoring capabilities.

I've also added a markdown with print-screens to guide users how to use this feature. You can find it here

* [Misc] Add channel-wise quantization support for w8a8 dynamic per token activation quantization (vllm-project#5542)

* [ci] Setup Release pipeline and build release wheels with cache (vllm-project#5610)

Signed-off-by: kevin <[email protected]>

* [Model] LoRA support added for command-r (vllm-project#5178)

* [Bugfix] Fix for inconsistent behaviour related to sampling and repetition penalties  (vllm-project#5639)

Signed-off-by: Thomas Parnell <[email protected]>

* [Doc] Added cerebrium as Integration option (vllm-project#5553)

* [Bugfix] Fix CUDA version check for mma warning suppression (vllm-project#5642)

* [Bugfix] Fix w8a8 benchmarks for int8 case (vllm-project#5643)

* [Bugfix] Fix Phi-3 Long RoPE scaling implementation (vllm-project#5628)

* [Bugfix] Added test for sampling repetition penalty bug. (vllm-project#5659)

Signed-off-by: Thomas Parnell <[email protected]>

* [Bugfix][CI/Build][AMD][ROCm]Fixed the cmake build bug which generate garbage on certain devices (vllm-project#5641)

* [misc][distributed] use 127.0.0.1 for single-node (vllm-project#5619)

* [Model] Add FP8 kv cache for Qwen2 (vllm-project#5656)

* [Bugfix] Fix sampling_params passed incorrectly in Phi3v example (vllm-project#5684)

* [Misc]Add param max-model-len in benchmark_latency.py (vllm-project#5629)

* [CI/Build] Add tqdm to dependencies (vllm-project#5680)

* [ci] Add A100 queue into AWS CI template (vllm-project#5648)

Signed-off-by: kevin <[email protected]>

* [Frontend][Bugfix] Fix preemption_mode -> preemption-mode for CLI arg in arg_utils.py (vllm-project#5688)

* [ci][distributed] add tests for custom allreduce (vllm-project#5689)

* [Bugfix] AsyncLLMEngine hangs with asyncio.run (vllm-project#5654)

* [Doc] Update docker references (vllm-project#5614)

Signed-off-by: Rafael Vasquez <[email protected]>

* [Misc] Add per channel support for static activation quantization; update w8a8 schemes to share base classes (vllm-project#5650)

* [ci] Limit num gpus if specified for A100 (vllm-project#5694)

Signed-off-by: kevin <[email protected]>

* [Misc] Improve conftest (vllm-project#5681)

* [Bugfix][Doc] FIx Duplicate Explicit Target Name Errors (vllm-project#5703)

* [Kernel] Update Cutlass int8 kernel configs for SM90 (vllm-project#5514)

Co-authored-by: Varun Sundar Rabindranath <[email protected]>

* [Model] Port over CLIPVisionModel for VLMs (vllm-project#5591)

* [Kernel] Update Cutlass int8 kernel configs for SM80 (vllm-project#5275)

Co-authored-by: Varun Sundar Rabindranath <[email protected]>

* [Bugfix] Fix the CUDA version check for FP8 support in the CUTLASS kernels (vllm-project#5715)

* [Frontend] Add FlexibleArgumentParser to support both underscore and dash in names (vllm-project#5718)

* [distributed][misc] use fork by default for mp (vllm-project#5669)

* [Model] MLPSpeculator speculative decoding support (vllm-project#4947)

Signed-off-by: Thomas Parnell <[email protected]>

Co-authored-by: Thomas Parnell <[email protected]>
Co-authored-by: Nick Hill <[email protected]>
Co-authored-by: Davis Wertheimer <[email protected]>

* [Kernel] Add punica dimension for Qwen2 LoRA (vllm-project#5441)

* [BugFix] Fix test_phi3v.py (vllm-project#5725)

* [Bugfix] Add  fully sharded layer for QKVParallelLinearWithLora (vllm-project#5665)

Co-authored-by: Antoni Baum <[email protected]>

* [Core][Distributed] add shm broadcast (vllm-project#5399)

Co-authored-by: Cody Yu <[email protected]>

* [Kernel][CPU] Add Quick `gelu` to CPU (vllm-project#5717)

* [Doc] Documentation on supported hardware for quantization methods (vllm-project#5745)

* [BugFix] exclude version 1.15.0 for modelscope (vllm-project#5668)

* [ci][test] fix ca test in main (vllm-project#5746)

* [LoRA] Add support for pinning lora adapters in the LRU cache (vllm-project#5603)

* [CI][Hardware][Intel GPU] add Intel GPU(XPU) ci pipeline (vllm-project#5616)

* [Model] Support Qwen-VL and Qwen-VL-Chat models with text-only inputs (vllm-project#5710)

Co-authored-by: Roger Wang <[email protected]>

* [Misc] Remove vllm-project#4789 workaround left in vllm/entrypoints/openai/run_batch.py (vllm-project#5756)

* [Bugfix] Fix pin_lora error in TPU executor (vllm-project#5760)

* [Docs][TPU] Add installation tip for TPU (vllm-project#5761)

* [core][distributed] improve shared memory broadcast (vllm-project#5754)

* [BugFix] [Kernel] Add Cutlass2x fallback kernels (vllm-project#5744)

Co-authored-by: Varun Sundar Rabindranath <[email protected]>

* [Distributed] Add send and recv helpers (vllm-project#5719)

* [Bugfix] Add phi3v resize for dynamic shape and fix torchvision requirement (vllm-project#5772)

* [doc][faq] add warning to download models for every nodes (vllm-project#5783)

* post-rebase api adjustments

* [Doc] Add "Suggest edit" button to doc pages (vllm-project#5789)

* [Doc] Add Phi-3-medium to list of supported models (vllm-project#5788)

* [Bugfix] Fix FlexibleArgumentParser replaces _ with - for actual args (vllm-project#5795)

* [ci] Remove aws template (vllm-project#5757)

Signed-off-by: kevin <[email protected]>

* [Doc] Add notice about breaking changes to VLMs (vllm-project#5818)

* [Speculative Decoding] Support draft model on different tensor-parallel size than target model (vllm-project#5414)

* add pin_lora to habana components

* add WA for model loader

* fix api mismatches with ray

* tensor parallel fixes

* workers cpu alignment fix

* [Misc] Remove useless code in cpu_worker (vllm-project#5824)

* prefill/decode metadata fixes

* [Core] Add fault tolerance for `RayTokenizerGroupPool` (vllm-project#5748)

* re-enable attn metadata trimming

* worker_use_ray fix

* [doc][distributed] add both gloo and nccl tests (vllm-project#5834)

* [CI/Build] Add unit testing for FlexibleArgumentParser (vllm-project#5798)

* [Misc] Update `w4a16` `compressed-tensors` support to include `w8a16` (vllm-project#5794)

* [Hardware][TPU] Refactor TPU backend (vllm-project#5831)

* [Hardware][AMD][CI/Build][Doc] Upgrade to ROCm 6.1, Dockerfile improvements, test fixes (vllm-project#5422)

* [Hardware][TPU] Raise errors for unsupported sampling params (vllm-project#5850)

* [CI/Build] Add E2E tests for MLPSpeculator (vllm-project#5791)

Signed-off-by: Thomas Parnell <[email protected]>

* [Bugfix] Fix assertion in NeuronExecutor (vllm-project#5841)

* [Core] Refactor Worker and ModelRunner to consolidate control plane communication (vllm-project#5408)

Signed-off-by: Stephanie Wang <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Co-authored-by: Stephanie <[email protected]>

* [Misc][Doc] Add Example of using OpenAI Server with VLM (vllm-project#5832)

* [bugfix][distributed] fix shm broadcast when the queue size is full (vllm-project#5801)

* [Bugfix] Fix embedding to support 2D inputs (vllm-project#5829)

* [Bugfix][TPU] Fix KV cache size calculation (vllm-project#5860)

* [CI/Build] Refactor image test assets (vllm-project#5821)

* [Kernel] Adding bias epilogue support for `cutlass_scaled_mm` (vllm-project#5560)

Co-authored-by: Chih-Chieh-Yang <[email protected]>
Co-authored-by: Lucas Wilkinson <[email protected]>

* [Frontend] Add tokenize/detokenize endpoints (vllm-project#5054)

* [Hardware][TPU] Support parallel sampling & Swapping (vllm-project#5855)

* [Bugfix][TPU] Fix CPU cache allocation (vllm-project#5869)

* Support CPU inference with VSX PowerPC ISA (vllm-project#5652)

* [doc] update usage of env var to avoid conflict (vllm-project#5873)

* [Misc] Add example for LLaVA-NeXT (vllm-project#5879)

* [BugFix] Fix cuda graph for MLPSpeculator (vllm-project#5875)

Co-authored-by: Abhinav Goyal <[email protected]>

* [Doc] Add note about context length in Phi-3-Vision example (vllm-project#5887)

* [VLM][Bugfix] Make sure that `multi_modal_kwargs` is broadcasted properly (vllm-project#5880)

Signed-off-by: Xiaowei Jiang <[email protected]>

* [Model] Add base class for LoRA-supported models (vllm-project#5018)

* [Bugfix] Fix img_sizes Parsing in Phi3-Vision (vllm-project#5888)

* [CI/Build] [1/3] Reorganize entrypoints tests (vllm-project#5526)

* add collective crash WA

* add comment to the weird mark_step

* [Model][Bugfix] Implicit model flags and reenable Phi-3-Vision (vllm-project#5896)

* [doc][misc] add note for Kubernetes users (vllm-project#5916)

* [BugFix] Fix `MLPSpeculator` handling of `num_speculative_tokens` (vllm-project#5876)

* [BugFix] Fix `min_tokens` behaviour for multiple eos tokens (vllm-project#5849)

* [CI/Build] Fix Args for `_get_logits_warper` in Sampler Test (vllm-project#5922)

* [Model] Add Gemma 2 (vllm-project#5908)

* [core][misc] remove logical block (vllm-project#5882)

* [Kernel][ROCm][AMD] fused_moe Triton configs v2 for mi300X (vllm-project#5932)

* [Hardware][TPU] Optimize KV cache swapping (vllm-project#5878)

* [VLM][BugFix] Make sure that `multi_modal_kwargs` can broadcast properly with ring buffer. (vllm-project#5905)

Signed-off-by: Xiaowei Jiang <[email protected]>
Co-authored-by: Roger Wang <[email protected]>

* [Bugfix][Hardware][Intel CPU] Fix unpassed multi_modal_kwargs for CPU runner (vllm-project#5956)

* [Core] Registry for processing model inputs (vllm-project#5214)

Co-authored-by: ywang96 <[email protected]>

* Unmark fused_moe config json file as executable (vllm-project#5960)

* [Hardware][Intel] OpenVINO vLLM backend (vllm-project#5379)

* [Bugfix] Better error message for MLPSpeculator when `num_speculative_tokens` is set too high (vllm-project#5894)

Signed-off-by: Thomas Parnell <[email protected]>

* [CI/Build] [2/3] Reorganize entrypoints tests (vllm-project#5904)

* [Distributed] Make it clear that % should not be in tensor dict keys. (vllm-project#5927)

Signed-off-by: Xiaowei Jiang <[email protected]>

* [Spec Decode] Introduce DraftModelRunner (vllm-project#5799)

* [Bugfix] Fix compute datatype for cutlass 3.x epilogues (vllm-project#5931)

* [ Misc ] Remove `fp8_shard_indexer` from Col/Row Parallel Linear (Simplify Weight Loading) (vllm-project#5928)

Co-authored-by: Robert Shaw <rshaw@neuralmagic>

* [ Bugfix ] Enabling Loading Models With Fused QKV/MLP on Disk with FP8 (vllm-project#5921)

Co-authored-by: Robert Shaw <rshaw@neuralmagic>

* Support Deepseek-V2 (vllm-project#4650)

Co-authored-by: Philipp Moritz <[email protected]>

* [Bugfix] Only add `Attention.kv_scale` if kv cache quantization is enabled (vllm-project#5936)

* Unmark more files as executable (vllm-project#5962)

* [Bugfix] Fix Engine Failing After Invalid Request - AsyncEngineDeadError (vllm-project#5963)

Co-authored-by: Robert Shaw <rshaw@neuralmagic>

* [Kernel] Flashinfer for prefill & decode, with Cudagraph support for decode (vllm-project#4628)

Co-authored-by: LiuXiaoxuanPKU <[email protected]>, bong-furiosa <[email protected]>

* [Bugfix][TPU] Fix TPU sampler output (vllm-project#5978)

* [Bugfix][TPU] Fix pad slot id (vllm-project#5977)

* [Bugfix] fix missing last itl in openai completions benchmark (vllm-project#5926)

* [Misc] Extend vLLM Metrics logging API (vllm-project#5925)

Co-authored-by: Antoni Baum <[email protected]>

* [Kernel] Add punica dimensions for Granite 3b and 8b (vllm-project#5930)

Signed-off-by: Joe Runde <[email protected]>

* [Bugfix] Fix precisions in Gemma 1 (vllm-project#5913)

* [Misc] Update Phi-3-Vision Example (vllm-project#5981)

Co-authored-by: Cyrus Leung <[email protected]>

* [Bugfix] Support `eos_token_id` from `config.json` (vllm-project#5954)

* [Core] Optimize `SequenceStatus.is_finished` by switching to IntEnum (vllm-project#5974)

* [Kernel] Raise an exception in MoE kernel if the batch size is larger then 65k (vllm-project#5939)

* [ CI/Build ] Added E2E Test For Compressed Tensors (vllm-project#5839)

Co-authored-by: Michael Goin <[email protected]>
Co-authored-by: Robert Shaw <rshaw@neuralmagic>

* [CI/Build] Add TP test for vision models (vllm-project#5892)

* [ CI/Build ] LM Eval Harness Based CI Testing (vllm-project#5838)

Co-authored-by: Robert Shaw <rshaw@neuralmagic>

* [Bugfix][CI/Build][Hardware][AMD] Install matching torchvision to fix AMD tests (vllm-project#5949)

* [CI/Build] Temporarily Remove Phi3-Vision from TP Test (vllm-project#5989)

* [CI/Build] Reuse code for checking output consistency (vllm-project#5988)

* [CI/Build] [3/3] Reorganize entrypoints tests (vllm-project#5966)

* [ci][distributed] fix device count call

[ci][distributed] fix some cuda init that makes it necessary to use spawn (vllm-project#5991)

* [Frontend]: Support base64 embedding (vllm-project#5935)

Co-authored-by: Cyrus Leung <[email protected]>

* [Lora] Use safetensor keys instead of adapter_config.json to find unexpected modules.  (vllm-project#5909)

Co-authored-by: sang <[email protected]>

* [ CI ] Temporarily Disable Large LM-Eval Tests (vllm-project#6005)

Co-authored-by: [email protected] <rshaw@neuralmagic>

* [Misc] Fix `get_min_capability` (vllm-project#5971)

* [ Misc ] Refactor w8a8 to use `process_weights_after_load` (Simplify Weight Loading) (vllm-project#5940)

Co-authored-by: Robert Shaw <rshaw@neuralmagic>

* [misc][cuda] use nvml to avoid accidentally cuda initialization (vllm-project#6007)

* [Speculative Decoding 2/2 ] Integrate typical acceptance sampler into Spec Decode Worker (vllm-project#5348)

* Revert test changes

* cleanup

* llm engine cleanup

* utils.py cleanup

* custom ops refactor

* move xops to ops

* remove vllm/hpu/attn_bias.py

* whitespace fix

* revert accidental changes in rmsnorm

* Fix hpugraph hashing

* add trim_attn_metadata comment

* fix prompt bucketing:

* [ CI ] Re-enable Large Model LM Eval (vllm-project#6031)

* [doc][misc] remove deprecated api server in doc (vllm-project#6037)

* [Misc] update benchmark backend for scalellm (vllm-project#6018)

* [doc][misc] further lower visibility of simple api server (vllm-project#6041)

Co-authored-by: Simon Mo <[email protected]>

* [Bugfix] Use RayActorError for older versions of Ray in  RayTokenizerGroupPool (vllm-project#6039)

* [Bugfix] adding chunking mechanism to fused_moe to handle large inputs (vllm-project#6029)

* add FAQ doc under 'serving' (vllm-project#5946)

* [Bugfix][Doc] Fix Doc Formatting (vllm-project#6048)

* [Bugfix] Add explicit `end_forward` calls to flashinfer (vllm-project#6044)

* [BugFix] Ensure worker model loop is always stopped at the right time (vllm-project#5987)

* [Frontend] Relax api url assertion for openai benchmarking (vllm-project#6046)

* [Model] Changes to MLPSpeculator to support tie_weights and input_scale (vllm-project#5965)

Signed-off-by: Thomas Parnell <[email protected]>
Co-authored-by: Joshua Rosenkranz <[email protected]>

* [Core] Optimize block_manager_v2 vs block_manager_v1 (to make V2 default)  (vllm-project#5602)

* [Frontend] Add template related params to request (vllm-project#5709)

* [VLM] Remove `image_input_type` from VLM config (vllm-project#5852)

Signed-off-by: Xiaowei Jiang <[email protected]>
Co-authored-by: Cyrus Leung <[email protected]>
Co-authored-by: Roger Wang <[email protected]>

* [Doc] Reinstate doc dependencies (vllm-project#6061)

* guard model loader wa for hpu

---------

Signed-off-by: Thomas Parnell <[email protected]>
Signed-off-by: Lei Wen <[email protected]>
Signed-off-by: Joe Runde <[email protected]>
Signed-off-by: kevin <[email protected]>
Signed-off-by: Rafael Vasquez <[email protected]>
Signed-off-by: Stephanie Wang <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Xiaowei Jiang <[email protected]>
Signed-off-by: Joe Runde <[email protected]>
Co-authored-by: Li, Jiang <[email protected]>
Co-authored-by: Jianan Gu <[email protected]>
Co-authored-by: Woosuk Kwon <[email protected]>
Co-authored-by: Cyrus Leung <[email protected]>
Co-authored-by: Roger Wang <[email protected]>
Co-authored-by: Tyler Michael Smith <[email protected]>
Co-authored-by: Michael Goin <[email protected]>
Co-authored-by: youkaichao <[email protected]>
Co-authored-by: zifeitong <[email protected]>
Co-authored-by: Robert Shaw <[email protected]>
Co-authored-by: Cody Yu <[email protected]>
Co-authored-by: Philipp Moritz <[email protected]>
Co-authored-by: Antoni Baum <[email protected]>
Co-authored-by: Jie Fu (傅杰) <[email protected]>
Co-authored-by: Allen.Dou <[email protected]>
Co-authored-by: Simon Mo <[email protected]>
Co-authored-by: Kuntai Du <[email protected]>
Co-authored-by: Dipika Sikka <[email protected]>
Co-authored-by: Sanger Steel <[email protected]>
Co-authored-by: Thomas Parnell <[email protected]>
Co-authored-by: leiwen83 <[email protected]>
Co-authored-by: Lei Wen <[email protected]>
Co-authored-by: SangBin Cho <[email protected]>
Co-authored-by: Alexander Matveev <[email protected]>
Co-authored-by: Nick Hill <[email protected]>
Co-authored-by: Amit Garg <[email protected]>
Co-authored-by: Charles Riggins <[email protected]>
Co-authored-by: Liqian Chen <[email protected]>
Co-authored-by: zhyncs <[email protected]>
Co-authored-by: Kunshang Ji <[email protected]>
Co-authored-by: Abhilash Majumder <[email protected]>
Co-authored-by: Abhilash Majumder <[email protected]>
Co-authored-by: Bruce Fontaine <[email protected]>
Co-authored-by: zifeitong <[email protected]>
Co-authored-by: sroy745 <[email protected]>
Co-authored-by: Isotr0py <[email protected]>
Co-authored-by: Joe Runde <[email protected]>
Co-authored-by: Chang Su <[email protected]>
Co-authored-by: Roger Wang <[email protected]>
Co-authored-by: Kevin H. Luu <[email protected]>
Co-authored-by: Ronen Schaffer <[email protected]>
Co-authored-by: sergey-tinkoff <[email protected]>
Co-authored-by: milo157 <[email protected]>
Co-authored-by: Shukant Pal <[email protected]>
Co-authored-by: Hongxia Yang <[email protected]>
Co-authored-by: DearPlanet <[email protected]>
Co-authored-by: Rafael Vasquez <[email protected]>
Co-authored-by: Varun Sundar Rabindranath <[email protected]>
Co-authored-by: Varun Sundar Rabindranath <[email protected]>
Co-authored-by: Joshua Rosenkranz <[email protected]>
Co-authored-by: Davis Wertheimer <[email protected]>
Co-authored-by: Jinzhen Lin <[email protected]>
Co-authored-by: Jee Li <[email protected]>
Co-authored-by: rohithkrn <[email protected]>
Co-authored-by: Murali Andoorveedu <[email protected]>
Co-authored-by: Woo-Yeon Lee <[email protected]>
Co-authored-by: Matt Wong <[email protected]>
Co-authored-by: aws-patlange <[email protected]>
Co-authored-by: Stephanie Wang <[email protected]>
Co-authored-by: Stephanie <[email protected]>
Co-authored-by: Luka Govedič <[email protected]>
Co-authored-by: Chih-Chieh-Yang <[email protected]>
Co-authored-by: Lucas Wilkinson <[email protected]>
Co-authored-by: sasha0552 <[email protected]>
Co-authored-by: Chip Kerchner <[email protected]>
Co-authored-by: Abhinav Goyal <[email protected]>
Co-authored-by: xwjiang2010 <[email protected]>
Co-authored-by: Divakar Verma <[email protected]>
Co-authored-by: Ilya Lavrenov <[email protected]>
Co-authored-by: Robert Shaw <rshaw@neuralmagic>
Co-authored-by: wangding zeng <[email protected]>
Co-authored-by: Lily Liu <[email protected]>
Co-authored-by: LiuXiaoxuanPKU <[email protected]>, bong-furiosa <[email protected]>
Co-authored-by: mcalman <[email protected]>
Co-authored-by: William Lin <[email protected]>
Co-authored-by: Cyrus Leung <[email protected]>
Co-authored-by: llmpros <[email protected]>
Co-authored-by: sang <[email protected]>
Co-authored-by: Avshalom Manevich <[email protected]>
Co-authored-by: James Whedbee <[email protected]>
Co-authored-by: Joshua Rosenkranz <[email protected]>
Co-authored-by: danieljannai21 <[email protected]>
xjpang pushed a commit to xjpang/vllm that referenced this pull request Jul 8, 2024
@timbmg
Copy link

timbmg commented Jul 8, 2024

Thanks for the PR and supporting Gemma 2! Will the 8k context length be supported in the future?

@jvlinsta
Copy link

jvlinsta commented Jul 8, 2024

Multiple sources (e.g., https://www.reddit.com/r/LocalLLaMA/comments/1dusu3s/gemma_2_finetuning_2x_faster_63_less_memory_best/) have confirmed that softcapping is an absolute necessity for the 27b checkpoint. Are there any plans of making this available in vllm? Otherwise, the generation of the 27b checkpoint is useless...

@robertgshaw2-neuralmagic
Copy link
Sponsor Collaborator

Multiple sources (e.g., https://www.reddit.com/r/LocalLLaMA/comments/1dusu3s/gemma_2_finetuning_2x_faster_63_less_memory_best/) have confirmed that softcapping is an absolute necessity for the 27b checkpoint. Are there any plans of making this available in vllm? Otherwise, the generation of the 27b checkpoint is useless...

Release v0.5.1 from the weekend supports logits soft capping with the FLASHINFER attention backend

@lonngxiang
Copy link

Multiple sources (e.g., https://www.reddit.com/r/LocalLLaMA/comments/1dusu3s/gemma_2_finetuning_2x_faster_63_less_memory_best/) have confirmed that softcapping is an absolute necessity for the 27b checkpoint. Are there any plans of making this available in vllm? Otherwise, the generation of the 27b checkpoint is useless...

Release v0.5.1 from the weekend supports logits soft capping with the FLASHINFER attention backend
run error
image
image

@robertgshaw2-neuralmagic
Copy link
Sponsor Collaborator

  • Please do not post screenshots of error messages, they are difficult to parse and are not searchable
  • You have the wrong versions of FlashInfer installed.

Make sure that you match the proper torch and CUDA versions (torch 2.3 and likely cuda 12.1 is what you want)

@Hi-archers
Copy link

Multiple sources (e.g., https://www.reddit.com/r/LocalLLaMA/comments/1dusu3s/gemma_2_finetuning_2x_faster_63_less_memory_best/) have confirmed that softcapping is an absolute necessity for the 27b checkpoint. Are there any plans of making this available in vllm? Otherwise, the generation of the 27b checkpoint is useless...

Release v0.5.1 from the weekend supports logits soft capping with the FLASHINFER attention backend

Thank you very much for your contribution, but @Hi-archers in #6166 (comment) currently has several users experiencing a "Segmentation fault (core dumped)" error after performing extensive Gemma2 inferences using the FlashInfer backend. My current environment is Torch 2.3.0, Cuda 12.1, and FlashInfer 0.08. I hope you can address this issue. Thank you.

@robertgshaw2-neuralmagic
Copy link
Sponsor Collaborator

FlashInfer is built for specific CUDA versions and PyTorch versions. So you can have CUDA 12.1 and Torch2.3.0 but you may have installed FlashInfer built with Torch 2.2.0.

When this happens, we will get the error BatchDecodeWithPagedKVCacheWrapper

The default whl for vllm is Python 2.3 and CUDA 12.1. So you likely want to install the following FlashInfer whl:

PYTHON_VERSION=310
wget https://github.com/flashinfer-ai/flashinfer/releases/download/v0.0.8/flashinfer-0.0.8+cu121torch2.3-cp${PYTHON_VERSION}-cp${PYTHON_VERSION}-linux_x86_64.whl

@lonngxiang
Copy link

FlashInfer is built for specific CUDA versions and PyTorch versions. So you can have CUDA 12.1 and Torch2.3.0 but you may have installed FlashInfer built with Torch 2.2.0.

When this happens, we will get the error BatchDecodeWithPagedKVCacheWrapper

The default whl for vllm is Python 2.3 and CUDA 12.1. So you likely want to install the following FlashInfer whl:

PYTHON_VERSION=310
wget https://github.com/flashinfer-ai/flashinfer/releases/download/v0.0.8/flashinfer-0.0.8+cu121torch2.3-cp${PYTHON_VERSION}-cp${PYTHON_VERSION}-linux_x86_64.whl

TKS, Has been running, but the openai interface call answer has been empty.

image

@robertgshaw2-neuralmagic
Copy link
Sponsor Collaborator

Please refrain from posting images of your errors. Rather, paste the the test so that I can copy/paste and so that it is searchable

Can you please try the instruction model rather than the pretrained model with the chat interface?

@Hi-archers
Copy link

FlashInfer is built for specific CUDA versions and PyTorch versions. So you can have CUDA 12.1 and Torch2.3.0 but you may have installed FlashInfer built with Torch 2.2.0.

When this happens, we will get the error BatchDecodeWithPagedKVCacheWrapper

The default whl for vllm is Python 2.3 and CUDA 12.1. So you likely want to install the following FlashInfer whl:

PYTHON_VERSION=310
wget https://github.com/flashinfer-ai/flashinfer/releases/download/v0.0.8/flashinfer-0.0.8+cu121torch2.3-cp${PYTHON_VERSION}-cp${PYTHON_VERSION}-linux_x86_64.whl

Thank you for your response. However, even after following your instructions to install FLASHINFER, I still encountered a Segmentation fault (core dumped). This time it occurred at 3729/3822 lines, whereas previously it happened at 3708/3822 lines. Should I open a new issue to address this problem?

@robertgshaw2-neuralmagic
Copy link
Sponsor Collaborator

Can you do pip show vllm and tell me what you see?

@Hi-archers
Copy link

Can you do pip show vllm and tell me what you see?

pip show vllm:

Name: vllm
Version: 0.5.1
Summary: A high-throughput and memory-efficient inference and serving engine for LLMs
Home-page: https://github.com/vllm-project/vllm
Author: vLLM Team
Author-email:
License: Apache 2.0
Location: /home/weizihao/miniconda3/envs/gemma/lib/python3.10/site-packages
Requires: aiohttp, cmake, fastapi, filelock, lm-format-enforcer, ninja, numpy, nvidia-ml-py, openai, outlines, pillow, prometheus-client, prometheus-fastapi-instrumentator, psutil, py-cpuinfo, pydantic, ray, requests, sentencepiece, tiktoken, tokenizers, torch, torchvision, tqdm, transformers, typing-extensions, uvicorn, vllm-flash-attn, xformers
Required-by:

My Code:

import json
import time

from vllm import LLM, SamplingParams
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

import argparse

from tqdm import tqdm

import os
import sys

os.environ["VLLM_ATTENTION_BACKEND"] = "FLASHINFER"
os.environ["HF_TOKEN"] = "<TOKEN>"

parser = argparse.ArgumentParser()
parser.add_argument('--top', type=str, default="3")
parser.add_argument('--seed', type=int, default=42)
parser.add_argument('--cuda', type=int, default=1)
parser.add_argument('--utili', type=float, default=1)
parser.add_argument('--model_name', type=str, default="/data1/**/Gemma2/gemma-2-9b-it")
parser.add_argument('--title', type=int, default=1)
parser.add_argument('--temperature', type=float, default=0.)

args = parser.parse_args()

print(args)

os.environ["CUDA_VISIBLE_DEVICES"] = str(args.cuda)
sys.path.append(os.path.abspath("../../"))

from system_prompt import system_prompts, demonstration, instruction

sampling_params = SamplingParams(
    temperature=args.temperature,
    seed=args.seed,
    max_tokens=100,
    )

print(sampling_params)

model_name = args.model_name
tokenizer = AutoTokenizer.from_pretrained(model_name)

llm = LLM(
    model=model_name,
    seed=args.seed,
    gpu_memory_utilization=args.utili,
    )

if __name__ == "__main__":


    answer = []
    prompts = []

    for i, line in tqdm(enumerate(que), total=len(que)):
        for i_line in tmp:
            prompts.append(get_template(i_line["que"], i_line['A'], i_line["B"]))

    print(len(prompts)) # 3822

    outputs = llm.generate(prompts, sampling_params)

I removed the irrelevant code from my code.

@lonngxiang
Copy link

Please refrain from posting images of your errors. Rather, paste the the test so that I can copy/paste and so that it is searchable

Can you please try the instruction model rather than the pretrained model with the chat interface?

I downloaded the wrong version. It's working fine now.

@jvlinsta
Copy link

jvlinsta commented Jul 9, 2024

I can get it to run with flashinfer as the attention backend, but results are still abysmal.
Any idea what could still be different from the original implementation?

@noamgai21
Copy link

noamgai21 commented Jul 9, 2024

Hi! I'm using the latest vLLM image on docker, on GCP using A100 GPUs. I'm getting the following error when making many requests to the OpenAI server, using the 27GB instruction tuned model:

2024-07-09 13:06:08.540 | NotImplementedError |  
-- | -- | --
  |   | 2024-07-09 13:06:08.540 | raise NotImplementedError |  
  |   | 2024-07-09 13:06:08.540 | self.attn_backend.copy_blocks(self.gpu_cache, src_to_dsts) |  
  |   | 2024-07-09 13:06:08.540 | self.cache_engine[virtual_engine].copy(worker_input.blocks_to_copy) |  
  |   | 2024-07-09 13:06:08.540 | return func(*args, **kwargs) |  
  |   | 2024-07-09 13:06:08.540 | self.execute_worker(worker_input) |  
  |   | 2024-07-09 13:06:08.540 | raise result |  
  |   | 2024-07-09 13:06:08.540 | async for request_output in stream: |  
  |   | 2024-07-09 13:06:08.540 | raise e |  
  |   | 2024-07-09 13:06:08.540 | async for output in self._process_request( |  
  |   | 2024-07-09 13:06:08.540 | async for res in result_generator: |  
  |   | 2024-07-09 13:06:08.540 | return await self.chat_completion_full_generator( |  
  |   | 2024-07-09 13:06:08.540 | return await dependant.call(**values) |  
  |   | 2024-07-09 13:06:08.540 | await app(scope, receive, sender) |  
  |   | 2024-07-09 13:06:08.540 | raise exc |  
  |   | 2024-07-09 13:06:08.540 | await wrap_app_handling_exceptions(app, request)(scope, receive, send) |  
  |   | 2024-07-09 13:06:08.540 | await self.app(scope, receive, send) |  
  |   | 2024-07-09 13:06:08.539 | await route.handle(scope, receive, send) |  
  |   | 2024-07-09 13:06:08.539 | await self.middleware_stack(scope, receive, send) |  
  |   | 2024-07-09 13:06:08.539 | await app(scope, receive, sender) |  
  |   | 2024-07-09 13:06:08.539 | raise exc

This is with vLLM 0.5.1 with
VLLM_ATTENTION_BACKEND=FLASHINFER and --disable-sliding-window flags. I sshed to the machine and saw that the correct version of FlashInfer is installed (0.0.8, torch 2.3).

What am I doing wrong?
Indeed this seems to be the case:

raise NotImplementedError

@orellavie1212
Copy link
Contributor

orellavie1212 commented Jul 9, 2024

Hi! I'm using the latest vLLM image on docker, on GCP using A100 GPUs. I'm getting the following error when making many requests to the OpenAI server, using the 27GB instruction tuned model:

2024-07-09 13:06:08.540 | NotImplementedError |  
-- | -- | --
  |   | 2024-07-09 13:06:08.540 | raise NotImplementedError |  
  |   | 2024-07-09 13:06:08.540 | self.attn_backend.copy_blocks(self.gpu_cache, src_to_dsts) |  
  |   | 2024-07-09 13:06:08.540 | self.cache_engine[virtual_engine].copy(worker_input.blocks_to_copy) |  
  |   | 2024-07-09 13:06:08.540 | return func(*args, **kwargs) |  
  |   | 2024-07-09 13:06:08.540 | self.execute_worker(worker_input) |  
  |   | 2024-07-09 13:06:08.540 | raise result |  
  |   | 2024-07-09 13:06:08.540 | async for request_output in stream: |  
  |   | 2024-07-09 13:06:08.540 | raise e |  
  |   | 2024-07-09 13:06:08.540 | async for output in self._process_request( |  
  |   | 2024-07-09 13:06:08.540 | async for res in result_generator: |  
  |   | 2024-07-09 13:06:08.540 | return await self.chat_completion_full_generator( |  
  |   | 2024-07-09 13:06:08.540 | return await dependant.call(**values) |  
  |   | 2024-07-09 13:06:08.540 | await app(scope, receive, sender) |  
  |   | 2024-07-09 13:06:08.540 | raise exc |  
  |   | 2024-07-09 13:06:08.540 | await wrap_app_handling_exceptions(app, request)(scope, receive, send) |  
  |   | 2024-07-09 13:06:08.540 | await self.app(scope, receive, send) |  
  |   | 2024-07-09 13:06:08.539 | await route.handle(scope, receive, send) |  
  |   | 2024-07-09 13:06:08.539 | await self.middleware_stack(scope, receive, send) |  
  |   | 2024-07-09 13:06:08.539 | await app(scope, receive, sender) |  
  |   | 2024-07-09 13:06:08.539 | raise exc

This is with vLLM 0.5.1 with VLLM_ATTENTION_BACKEND=FLASHINFER and --disable-sliding-window flags. I sshed to the machine and saw that the correct version of FlashInfer is installed (0.0.8, torch 2.3).

What am I doing wrong? Indeed this seems to be the case:

raise NotImplementedError

can you please share your code sample? how you load the gemma2 27b with its params?

@noamgai21
Copy link

Hi! I'm using the latest vLLM image on docker, on GCP using A100 GPUs. I'm getting the following error when making many requests to the OpenAI server, using the 27GB instruction tuned model:

2024-07-09 13:06:08.540 | NotImplementedError |  
-- | -- | --
  |   | 2024-07-09 13:06:08.540 | raise NotImplementedError |  
  |   | 2024-07-09 13:06:08.540 | self.attn_backend.copy_blocks(self.gpu_cache, src_to_dsts) |  
  |   | 2024-07-09 13:06:08.540 | self.cache_engine[virtual_engine].copy(worker_input.blocks_to_copy) |  
  |   | 2024-07-09 13:06:08.540 | return func(*args, **kwargs) |  
  |   | 2024-07-09 13:06:08.540 | self.execute_worker(worker_input) |  
  |   | 2024-07-09 13:06:08.540 | raise result |  
  |   | 2024-07-09 13:06:08.540 | async for request_output in stream: |  
  |   | 2024-07-09 13:06:08.540 | raise e |  
  |   | 2024-07-09 13:06:08.540 | async for output in self._process_request( |  
  |   | 2024-07-09 13:06:08.540 | async for res in result_generator: |  
  |   | 2024-07-09 13:06:08.540 | return await self.chat_completion_full_generator( |  
  |   | 2024-07-09 13:06:08.540 | return await dependant.call(**values) |  
  |   | 2024-07-09 13:06:08.540 | await app(scope, receive, sender) |  
  |   | 2024-07-09 13:06:08.540 | raise exc |  
  |   | 2024-07-09 13:06:08.540 | await wrap_app_handling_exceptions(app, request)(scope, receive, send) |  
  |   | 2024-07-09 13:06:08.540 | await self.app(scope, receive, send) |  
  |   | 2024-07-09 13:06:08.539 | await route.handle(scope, receive, send) |  
  |   | 2024-07-09 13:06:08.539 | await self.middleware_stack(scope, receive, send) |  
  |   | 2024-07-09 13:06:08.539 | await app(scope, receive, sender) |  
  |   | 2024-07-09 13:06:08.539 | raise exc

This is with vLLM 0.5.1 with VLLM_ATTENTION_BACKEND=FLASHINFER and --disable-sliding-window flags. I sshed to the machine and saw that the correct version of FlashInfer is installed (0.0.8, torch 2.3).
What am I doing wrong? Indeed this seems to be the case:

raise NotImplementedError

can you please share your code sample? how you load the gemma2 27b with its params?

We use vLLM through k8s, this is the relevant snippet from the yaml:

containers:
        - name: main
          command:
          # https://github.com/huggingface/text-generation-inference/issues/1330
          # Without this weird ldconfig trick, we will get a "libcuda.so not found" error.
            - bash
            - -c
            - |
              ldconfig
              echo "Setting VLLM_ATTENTION_BACKEND to FLASHINFER to use the FlashInfer backend. Required for gemma2 logit capping"
              export VLLM_ATTENTION_BACKEND=FLASHINFER
              echo "Starting vLLM server with --disable-sliding-window as version 0.5.1 requires it with FlashInfer backend."
              python3 -m vllm.entrypoints.openai.api_server --model google/gemma-2-27b-it --disable-sliding-window
          image: vllm/vllm-openai:latest

@bks5881
Copy link

bks5881 commented Jul 12, 2024

When I am running gemm2-9b-it on h100, 80GB. The speed is very slow for me, like 20 TPS, any idea why? I launched with Lora adapter. its like much faster on sglang, with 43TPS.

@yukavio
Copy link

yukavio commented Jul 15, 2024

Is there currently a plan to support sliding windows?

xjpang pushed a commit to xjpang/vllm that referenced this pull request Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new model Requests to new models
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Support for google/gemma-2-9b-it / gemma-2-27b-it