Run this model with HF Jobs

Run google/gemma-2-9b-it on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/google/gemma-2-9b-it. Ask me which dataset to train on, then push the fine-tuned model to a new private model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/google/gemma-2-9b-it on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/google/gemma-2-9b-it. Ask me which benchmark to run, then save the scores and the per-example results to a new private dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/google/gemma-2-9b-it. Push it to a new private model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Sliding window vs. Global Attention

#41
by tanliboy - opened

Since vLLM currently lacks sliding window support, how does this affect the model's performance?"

Hi @tanliboy ,

Let's Model 1 uses sliding window attention for every odd layer, Model 2 ignores it and uses global attention for all layers.

For an short articles:

  1. Model 1 might perform similarly to Model 2 on shorter articles because the sliding window attention can effectively capture most or all relevant dependencies within the article.
  2. Model 2 may have a slight edge if even short articles require linking distant information, but the difference might be negligible.

For an Long articles:

  1. Model 1 could struggle with long articles where important information is spread out. The sliding window might miss crucial connections, leading to summaries that overlook key points.
  2. Model 2 would likely outperform Model 1 by generating summaries that account for the entire article, identifying and linking information across different sections.

Thank you.

@GopiUppari Thanks for the detailed explanation of the sliding window!
I wanted to clarify my question: Given that vLLM doesn't support sliding windows and Gemma 2 models require them on odd layers, would serving Gemma 2 models with vLLM lead to suboptimal performance for inputs exceeding 4096 tokens?
I understand it could increase computational cost and memory usage, but I'm unsure whether the results of (Q * K^t) outside the sliding window would be masked out or still influence the final output.

I found it out based on this warning:

 utils.py:721] Gemma 2 uses sliding window attention for every odd layer, which is currently not supported by vLLM. Disabling sliding window and capping the max length to the sliding window size (4096).

With vLLM, the max token length will be reduced from 8k to 4k to fit into the length of the sliding window.

Hi @tanliboy , in order to fully utilize the original context length which gemma has been trained on, other serving tools (e.g. sglang) would be a great choice :)

Thank you, @Sangsang ! I cannot wait to try out the 6x performance improvement of SGLang.

vllm in v0.6.5 added full context for gemma2

Sign up or log in to comment