Run this model with HF Jobs

Run baselabs/elephant-1 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 to fine-tune https://huggingface.co/baselabs/elephant-1. Ask me which dataset to train on, then push the fine-tuned model to a new 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/baselabs/elephant-1 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.

Title: vLLM FlashAttention optimization for elephant-1 — 25–28% throughput improvement

#4
by divg07 - opened

Hi Base Labs team,

I've been working on optimizing elephant-1 inference in vLLM and submitted a PR:

https://github.com/vllm-project/vllm/pull/65222

The PR introduces a FlashAttention-2 fast path for PrefixLM prefill on Ampere/Ada GPUs (A100, A10, L4), replacing the existing Triton attention kernel for eligible workloads while preserving attention semantics.

Benchmarks on A100 80GB (~14.7K-token states):

  • 25–28% higher decision throughput across concurrency levels 1, 4, and 8.
  • ~23% lower p50 latency (2.2s → 1.7s).
  • 3× faster attention kernel (69ms → 23ms per layer).
  • No decision flips across 880 comparisons against the existing implementation.

These improvements were measured without prefix-cache reuse, making them particularly relevant for workloads with unique states.

Future optimization opportunities:

The current implementation targets Ampere/Ada GPUs, but the underlying approach could potentially be extended to Hopper (H100/H200) and Blackwell (B200/GB200) using architecture-optimized attention kernels such as FlashAttention-3/4.

This would require additional implementation and benchmarking, but could unlock similar opportunities for reducing PrefixLM prefill overhead on newer GPUs.

Request for review:

Would the Base Labs team be willing to help accelerate the upstream vLLM review, particularly by validating the attention semantics, benchmarking representative elephant-1 workloads, or coordinating with vLLM maintainers?

I'd also be interested in collaborating on further optimizations for elephant-1 and mammoth-1, including prefill throughput, batching, and KV-cache reuse.

Thanks!

Sign up or log in to comment