Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/workflows/lint_actions.yml

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/lint_code.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
contents: read

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
id: setup-python
with:
python-version: "3.12"

- uses: actions/cache@v4
with:
path: ~/.cache/prek
key: >
${{ format('pre-commit-{0}-{1}',
steps.setup-python.outputs.python-version,
hashFiles('.pre-commit-config.yaml')
) }}

- run: echo "::add-matcher::.github/workflows/matchers/ruff.json"
- uses: j178/prek-action@v1
with:
extra_args: --all-files --hook-stage manual
34 changes: 34 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
default_install_hook_types:
- pre-commit
- commit-msg
default_stages:
- pre-commit # Run locally
- manual # Run in CI
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.0
hooks:
- id: ruff
args: [--output-format, github, --fix]
- id: ruff-format
# args: [--diff] # Uncomment to show diffs (not reformatting files)
- repo: https://github.com/crate-ci/typos
rev: v1.35.5
hooks:
- id: typos
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.45.0
hooks:
- id: markdownlint
args: [
"--config",
"pyproject.toml",
"--configPointer",
"/tool/markdownlint",
]
exclude: '.*\.inc\.md'
stages: [manual] # Only run in CI
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
- id: actionlint
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ For more information, check out the following:
## Getting Started

Visit our [documentation](https://vllm-spyre.readthedocs.io/en/latest/):

- [Installation](https://vllm-spyre.readthedocs.io/en/latest/getting_started/installation.html)
- [List of Supported Models](https://vllm-spyre.readthedocs.io/en/latest/user_guide/supported_models.html)
- [List of Supported Features](https://vllm-spyre.readthedocs.io/en/latest/user_guide/supported_features.html)
Expand Down
12 changes: 9 additions & 3 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Release process

Currently, we only have a single release process for pushing releases off `main`. In the future we may need to maintain multiple release streams to handle compatibility with multiple released versions of vllm.
Currently, we only have a single release process for pushing releases off `main`.
In the future we may need to maintain multiple release streams to handle
compatibility with multiple released versions of vllm.

When ready to make a new release:

1. Create and push a tag on main for the next version, following the convention `vX.Y.Z`.
2. Create a new release on GitHub for this tag. Use the "Generate Release Notes" button to draft releast notes based on the changes since the last release.
2. Create a new release on GitHub for this tag. Use the "Generate Release Notes" button to draft release notes based on the changes since the last release.
3. Once the release is ready, publish it by clicking the "Publish release" button.
4. The `build-and-publish.yaml` workflow will trigger when the release is published, and push a new wheel to pypi

We could automate the process of creating the release on GitHub as well, however there is a slight snag that github actions cannot trigger from events that were performed by github actions. See: https://github.com/semantic-release/semantic-release/discussions/1906
<!-- markdownlint-disable no-bare-urls -->

We could automate the process of creating the release on GitHub as well, however,
there is a slight snag that GitHub Actions cannot trigger from events that were
performed by GitHub Actions. See: https://github.com/semantic-release/semantic-release/discussions/1906
7 changes: 6 additions & 1 deletion docs/contributing/continuous_batching/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Brief overview of what has been implemented so far in VLLM to test / debug conti
* **File paths:**
* `examples/offline_inference/cb_spyre_inference.py`
* `examples/offline_inference/long_context.py`
* **Purpose:** Debugging (ie. using manual execution)
* **Purpose:** Debugging (i.e. using manual execution)

### Description

Expand Down Expand Up @@ -81,8 +81,12 @@ For `long_context.py`: the same parameters, but with some differences:
VLLM_SPYRE_TEST_MODEL_LIST='tiny-granite-3.2-8b' python -m pytest -svx -m "spyre and cb" --forked tests/e2e/test_spyre_cb.py
```

<!-- markdownlint-disable MD024 no-duplicate-heading -->

### Description

<!-- markdownlint-enable MD024 -->

Unit tests are designed for automated and systematic execution to verify that CB behaves as expected for different scenarios. For each scenario (i.e. configuration of parameters), the test either passes or fails. When a test suite fails, identifying which specific test case failed is often more informative than the failure message itself. Below is a brief description of the different unit tests targeting CB. The description can also be found in the docstring of the different test functions:

!!! caution
Expand All @@ -102,6 +106,7 @@ Output tests checks the correctness of the output of CB on a set of prompts. For

!!! note inline end
This applies for sendnn backend, on CPU the tokens need to additionally be exactly the same for the test to pass

* The test passes if: the logprobs of HF on CPU and vLLM (on Spyre or CPU depending on the backend) are compared, and the test passes only if the pairwise relative differences of the values are all below a threshold: `math.isclose(hf_logprob, vllm_logprob, rel_tol=0.35)`. Otherwise it fails. There is no logic that takes into account the fact that the tokens might becomes different at some point, making the logits diverging.

#### Scheduler Steps Tests
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/images/vllm_v1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/contributing/images/vllm_v1_spyre.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,13 @@ Resolved 155 packages in 45ms
help: `xformers` (v0.0.28.post1) was included because `vllm-spyre` (v0.1.0) depends on `vllm` (v0.2.5) which depends on `xformers`
```

<!-- markdownlint-disable MD051 link-fragments -->

To avoid this error, make sure to include the dependency `--overrides` as described
in the installation from a [Release (PyPI)](#release-pypi) section.

<!-- markdownlint-enable MD051 -->

### No solution found when resolving dependencies

If you forget to override the `torch` dependencies when installing from PyPI you
Expand Down Expand Up @@ -233,5 +237,9 @@ $ uv pip install vllm-spyre==0.4.1
and you require vllm-spyre==0.4.1, we can conclude that your requirements are unsatisfiable.
```

<!-- markdownlint-disable MD051 link-fragments -->

To avoid this error, make sure to include the dependency `--overrides` as described
in the installation from a [Release (PyPI)](#release-pypi) section.

<!-- markdownlint-enable MD051 -->
17 changes: 9 additions & 8 deletions docs/mkdocs/hooks/generate_examples.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Sourced from https://github.com/vllm-project/vllm/blob/main/docs/mkdocs/hooks/generate_examples.py """ # noqa: E501
"""Sourced from https://github.com/vllm-project/vllm/blob/main/docs/mkdocs/hooks/generate_examples.py""" # noqa: E501

# SPDX-License-Identifier: Apache-2.0
import itertools
from dataclasses import dataclass, field
Expand All @@ -8,7 +9,7 @@
import regex as re

ROOT_DIR = Path(__file__).parent.parent.parent.parent
ROOT_DIR_RELATIVE = '../../../../..'
ROOT_DIR_RELATIVE = "../../../../.."
EXAMPLE_DIR = ROOT_DIR / "examples"
EXAMPLE_DOC_DIR = ROOT_DIR / "docs/examples"
print(ROOT_DIR.resolve())
Expand Down Expand Up @@ -37,7 +38,7 @@ def fix_case(text: str) -> str:
r"int\d+": lambda x: x.group(0).upper(), # e.g. int8, int16
}
for pattern, repl in subs.items():
text = re.sub(rf'\b{pattern}\b', repl, text, flags=re.IGNORECASE)
text = re.sub(rf"\b{pattern}\b", repl, text, flags=re.IGNORECASE)
return text


Expand All @@ -59,7 +60,8 @@ class Example:
determine_other_files() -> list[Path]: Determines other files in the directory excluding the main file.
determine_title() -> str: Determines the title of the document.
generate() -> str: Generates the documentation content.
""" # noqa: E501
""" # noqa: E501

path: Path
category: str = None
main_file: Path = field(init=False)
Expand All @@ -81,9 +83,8 @@ def determine_main_file(self) -> Path:
Markdown file found in the directory.
Raises:
IndexError: If no Markdown files are found in the directory.
""" # noqa: E501
return self.path if self.path.is_file() else list(
self.path.glob("*.md")).pop()
""" # noqa: E501
return self.path if self.path.is_file() else list(self.path.glob("*.md")).pop()

def determine_other_files(self) -> list[Path]:
"""
Expand All @@ -95,7 +96,7 @@ def determine_other_files(self) -> list[Path]:

Returns:
list[Path]: A list of Path objects representing the other files in the directory.
""" # noqa: E501
""" # noqa: E501
if self.path.is_file():
return []
is_other_file = lambda file: file.is_file() and file != self.main_file
Expand Down
9 changes: 4 additions & 5 deletions docs/mkdocs/hooks/url_schemes.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
""" Sourced from https://github.com/vllm-project/vllm/blob/main/docs/mkdocs/hooks/url_schemes.py """ # noqa: E501
"""Sourced from https://github.com/vllm-project/vllm/blob/main/docs/mkdocs/hooks/url_schemes.py""" # noqa: E501

import regex as re
from mkdocs.config.defaults import MkDocsConfig
from mkdocs.structure.files import Files
from mkdocs.structure.pages import Page


def on_page_markdown(markdown: str, *, page: Page, config: MkDocsConfig,
files: Files):
def on_page_markdown(markdown: str, *, page: Page, config: MkDocsConfig, files: Files):
gh_icon = ":octicons-mark-github-16:"
gh_url = "https://github.com"
repo_url = f"{gh_url}/vllm-project/vllm-spyre"
Expand All @@ -32,11 +31,11 @@ def on_page_markdown(markdown: str, *, page: Page, config: MkDocsConfig,
auto_link = re.compile(f"<{scheme}>")

def replace_inline_link(match: re.Match) -> str:
url = f'{urls[match.group("type")]}/{match.group("path")}'
url = f"{urls[match.group('type')]}/{match.group('path')}"
if fragment := match.group("fragment"):
url += f"#{fragment}"

return f'[{gh_icon} {match.group("title")}]({url})'
return f"[{gh_icon} {match.group('title')}]({url})"

def replace_auto_link(match: re.Match) -> str:
type = match.group("type")
Expand Down
Loading