Vidur: LLM Inference Simulator
Vidur is a high-fidelity and extensible LLM inference simulator. It can help you with:
- Capacity planning and finding the best deployment configuration for your LLM deployments.
- Test new research ideas like new scheduling algorithms, optimizations like speculative decoding, etc.
- Study the system performance of models under different workloads and configurations.
... all without access to GPUs except for a quick initial profiling phase.
Please refer to our MLSys'24 paper for more details. We have a talk with live demo that captures the capabilities of the system.
Supported Models
| Model / Device | A100 80GB DGX | H100 DGX | 4xA100 80GB Pairwise NVLink Node | 8xA40 Pairwise NVLink Node |
|---|---|---|---|---|
meta-llama/Llama-3-8B |
✅ | ✅ | ❌ | ❌ |
meta-llama/Llama-3-70B |
✅ | ✅ | ❌ | ❌ |
- Instructions on adding a new model to existing or new SKUs can be found here.
- All models support a maximum context length of 2M.
- Pipeline parallelism is supported for all models. The PP dimension should divide the number of layers in the model.
- In DGX nodes, there are 8 GPUs, fully connected via NVLink. So TP1, TP2, TP4 and TP8 are supported.
- In 4x pairwise NVLink nodes, there are 4 GPUs, so TP1, TP2 and TP4 are supported. TP4 here is less performant than TP4 in DGX nodes because (GPU1, GPU2) are connected via NVLink and (GPU3, GPU4) are connected via NVLink. but between these layers, the interconnect is slower.
- You can use any combination of TP and PP. For example, you can run LLaMA2-70B on TP2-PP2 on a 4xA100 80GB Pairwise NVLink Node.
Chrome Trace
Vidur exports chrome traces of each simulation. The trace can be found in the simulator_output directory. The trace can be opened by navigating to chrome://tracing/ or edge://tracing/ and loading the trace.
Setup
Using mamba
To run the simulator, create a mamba environment with the given dependency file.
mamba env create -p ./env -f ./environment-dev.yml
Using venv
- Ensure that you have Python 3.12 installed on your system. Refer https://www.bitecode.dev/p/installing-python-the-bare-minimum
cdinto the repository root- Create a virtual environment using
venvmodule usingpython3.12 -m venv .venv - Activate the virtual environment using
source .venv/bin/activate - Install the dependencies using
python -m pip install -r requirements.txt - Run
deactivateto deactivate the virtual environment
Using conda (Least recommended)
To run the simulator, create a conda environment with the given dependency file.
conda env create -p ./env -f ./environment.yml
conda env update -f environment-dev.yml
Setting up wandb (Optional)
First, setup your account on https://<your-org>.wandb.io/ or public wandb, obtain the api key and then run the following command,
wandb login --host https://<your-org>.wandb.io
To opt out of wandb, pick any one of the following methods:
export WANDB_MODE=disabledin your shell or add this in~/.zshrcor~/.bashrc. Remember to reload usingsource ~/.zshrc.- Set
wandb_projectandwandb_groupas""invidur/config/default.yml. Also, remove these CLI params from the shell command with which the simulator is invoked.
Running the simulator
To run the simulator, execute the following command from the repository root,
python -m vidur.main
or a big example with all the parameters,
python -m vidur.main \
--replica_config_device a100 \
--replica_config_model_name meta-llama/Llama-2-7b-hf \
--cluster_config_num_replicas 1 \
--replica_config_tensor_parallel_size 1 \
--replica_config_num_pipeline_stages 1 \
--request_generator_config_type synthetic \
--length_generator_config_type trace \
--interval_generator_config_type static \
--[trace|zipf|uniform|fixed]_request_length_generator_config_max_tokens 4096 \
--trace_request_length_generator_config_trace_file ./data/processed_traces/arxiv_summarization_stats_llama2_tokenizer_filtered_v2.csv \
--synthetic_request_generator_config_num_requests 128 \
--replica_scheduler_config_type vllm \
--[vllm|lightllm|orca|faster_transformer|sarathi]_scheduler_config_batch_size_cap 256 \
--[vllm|lightllm]_scheduler_config_max_tokens_in_batch 4096
The simulator supports a plethora of parameters for the simulation description which can be found here.
The metrics will be logged to wandb directly and a copy will be stored in the simulator_output directory along with the chrome trace. A description of all the logged metrics can be found here.
Formatting Code
To format code, execute the following command:
make format
Metadata
Release files for vidur 0.0.26
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vidur-0.0.26.tar.gz | 2.0 MB | Details |
Built distributions (wheels)
Total release size: 49.9 MB
Release files / vidur-0.0.26.tar.gz
| Download URL | vidur-0.0.26.tar.gz |
|---|---|
| Size | 2.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6b3ca065fc9828fbe634136df0dc02fa2b212f11be5d185457738b7c8a9edb94
|
|
BLAKE2b-256 checksum How to use checksums |
289667e05e80a5c85d041d5719332f69fdfbaf590b7f5a47aa8cedd7c236cac0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.
Transparency logRelease files / vidur-0.0.26-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | vidur-0.0.26-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | Linux glibc 2.17+ x86-64 PyPy 3.11 PyPy 3.11 7.3 |
|
SHA-256 checksum How to use checksums |
7cb157a3cd8baaf47510f944246e764c771456c6ddf5b5df46b8f5d8ce304dd8
|
|
BLAKE2b-256 checksum How to use checksums |
06eff6e07443d595800e177a2a56fd23ba2df2604b11e06aca527f9349cebc63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.
Transparency logRelease files / vidur-0.0.26-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | vidur-0.0.26-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | Linux glibc 2.17+ x86-64 PyPy 3.10 PyPy 3.10 7.3 |
|
SHA-256 checksum How to use checksums |
0136f04dd402513d42fce4345057299fbf2236c41d90e5e051842edc681e79f6
|
|
BLAKE2b-256 checksum How to use checksums |
859fb3f6aa99eefbc8f6695f73cf107f783dfd16ec0ce3bf1ff250abc0093f67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.
Transparency logRelease files / vidur-0.0.26-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | vidur-0.0.26-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 5.4 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
c001bf5112ec7d0c242c1d7c5fee1b8ec8859875cb51b788612fafe30721def7
|
|
BLAKE2b-256 checksum How to use checksums |
c2ae619573124e6f80227bc50b17e28e0d52a34f1090f7c4959225e43b54aa09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.
Transparency logRelease files / vidur-0.0.26-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | vidur-0.0.26-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
aca89f02c34baa204865d6dbc3c13483eac4d9b501fc21a6005140cf1bac1c4f
|
|
BLAKE2b-256 checksum How to use checksums |
f4451eba1d0d263485f9c02c916a61c1a79c84532512f21c500c364d56a43071
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.
Transparency logRelease files / vidur-0.0.26-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | vidur-0.0.26-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 5.4 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
0ab53614535da5752dd5a68fe23955cb1a17e49b2254123c3ad12c292391a764
|
|
BLAKE2b-256 checksum How to use checksums |
74fb916a6acef7e0f2fbad25f3da5d145936d32daa2fe60dc4419fbddb33f6ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.
Transparency logRelease files / vidur-0.0.26-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | vidur-0.0.26-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
70e96999901d324520f891f9881fd414e791e035ea3fd79d0e5ed05a262df69f
|
|
BLAKE2b-256 checksum How to use checksums |
666002a2d63e920d697c85211861fc3b836839308372fcbbe35ff74634842276
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.
Transparency logRelease files / vidur-0.0.26-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | vidur-0.0.26-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 5.4 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
4b83314b594cc2fcd52371c901f88fd4c548bb933a4fb1cd1e2ae040f2c1045a
|
|
BLAKE2b-256 checksum How to use checksums |
744f1bc60c6d6a6cf52c901c3c8aefae106dc24652f4971590ecf46b77f1ec41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.
Transparency logRelease files / vidur-0.0.26-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | vidur-0.0.26-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
b31aec590ec37b155aa279870854e84dff11f363a22768e5fa9b3ac0076bc80e
|
|
BLAKE2b-256 checksum How to use checksums |
c2d73dc0fd7775c79b7b1508c15a6f1776cb51e0139e1698e696580e189eb2c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.
Transparency logRelease files / vidur-0.0.26-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | vidur-0.0.26-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
010bb577ba549025f62d880c43f458bff214928ea8e5413cbb8a770e87fcffbc
|
|
BLAKE2b-256 checksum How to use checksums |
496a2c52a00b9c247d982162315a26299d19380390e1ce65401261749a5929d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.
Transparency logRelease files / vidur-0.0.26-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | vidur-0.0.26-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
4479031f448b9c95ad7636b5899110fdf39ba979097d721a1b3de336577a203a
|
|
BLAKE2b-256 checksum How to use checksums |
0945ed0fd3120ee6cdb7450adf0d661c0aaa4d0335b926a826a3e4cf431c751e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.
Transparency log