Skip to content

Commit df7461c

Browse files
authored
Merge branch 'main' into derekk/nvfp4-example-tests
2 parents 01f1dc6 + b88221b commit df7461c

29 files changed

+494
-426
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ instance/
9393
# Scrapy stuff:
9494
.scrapy
9595

96-
# Sphinx documentation
97-
docs/_build/
98-
9996
# PyBuilder
10097
target/
10198

@@ -129,6 +126,7 @@ venv.bak/
129126

130127
# mkdocs documentation
131128
/site
129+
docs/.cache/
132130

133131
# mypy
134132
.mypy_cache/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Some of the exciting new features include:
3838

3939
### When to Use Which Optimization
4040

41-
Please refer to [docs/schemes.md](./docs/schemes.md) for detailed information about available optimization schemes and their use cases.
41+
Please refer to [compression_schemes.md](./docs/guides/compression_schemes.md) for detailed information about available optimization schemes and their use cases.
4242

4343

4444
## Installation

docs/Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Minimal mkdocs makefile
2+
3+
PYTHON := python3
4+
MKDOCS_CMD := mkdocs
5+
MKDOCS_CONF := ../mkdocs.yml
6+
7+
.PHONY: help install serve build clean
8+
9+
help:
10+
@echo "Available targets:"
11+
@echo " install Install dependencies globally"
12+
@echo " serve Serve docs locally"
13+
@echo " build Build static site"
14+
@echo " clean Remove build artifacts"
15+
16+
install:
17+
pip install -e "../[dev]"
18+
19+
serve:
20+
$(MKDOCS_CMD) serve --livereload -f $(MKDOCS_CONF)
21+
22+
build:
23+
$(MKDOCS_CMD) build -f $(MKDOCS_CONF)
24+
25+
clean:
26+
rm -rf site/ .cache/

docs/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Getting started with LLM Compressor docs
2+
3+
```bash
4+
cd docs
5+
```
6+
7+
- Install the dependencies:
8+
9+
```bash
10+
make install
11+
```
12+
13+
- Clean the previous build (optional but recommended):
14+
15+
```bash
16+
make clean
17+
```
18+
19+
- Serve the docs:
20+
21+
```bash
22+
make serve
23+
```
24+
25+
This will start a local server at http://localhost:8000. You can now open your browser and view the documentation.

docs/developer/code-of-conduct.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: Code of Conduct
3+
weight: -10
4+
---
5+
6+
# LLM Compressor Code of Conduct
7+
8+
## Our Pledge
9+
10+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
13+
14+
## Our Standards
15+
16+
Examples of behavior that contributes to a positive environment for our community include:
17+
18+
- Demonstrating empathy and kindness toward other people
19+
- Being respectful of differing opinions, viewpoints, and experiences
20+
- Giving and gracefully accepting constructive feedback
21+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
22+
- Focusing on what is best not just for us as individuals, but for the overall community
23+
24+
Examples of unacceptable behavior include:
25+
26+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
27+
- Trolling, insulting or derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others’ private information, such as a physical or email address, without their explicit permission
30+
- Other conduct which could reasonably be considered inappropriate in a professional setting
31+
32+
## Enforcement Responsibilities
33+
34+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
35+
36+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
37+
38+
## Scope
39+
40+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
41+
42+
## Enforcement
43+
44+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement through GitHub, Slack, or Email. All complaints will be reviewed and investigated promptly and fairly.
45+
46+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
47+
48+
## Enforcement Guidelines
49+
50+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
51+
52+
### 1. Correction
53+
54+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
55+
56+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
57+
58+
### 2. Warning
59+
60+
**Community Impact**: A violation through a single incident or series of actions.
61+
62+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
63+
64+
### 3. Temporary Ban
65+
66+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
67+
68+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
69+
70+
### 4. Permanent Ban
71+
72+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
73+
74+
**Consequence**: A permanent ban from any sort of public interaction within the community.
75+
76+
## Attribution
77+
78+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
79+
80+
Community Impact Guidelines were inspired by [Mozilla’s code of conduct enforcement ladder](https://github.com/mozilla/diversity).
81+
82+
For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

docs/developer/contributing.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: Contributing Guide
3+
weight: -8
4+
---
5+
6+
# Contributing to LLM Compressor
7+
8+
Thank you for your interest in contributing to LLM Compressor!
9+
Our community is open to everyone and welcomes all kinds of contributions, no matter how small or large.
10+
There are several ways you can contribute to the project:
11+
12+
- Identify and report any issues or bugs.
13+
- Request or add new compression methods or research.
14+
- Suggest or implement new features.
15+
16+
However, remember that contributions aren't just about code.
17+
We believe in the power of community support; thus, answering queries, assisting others, and enhancing the documentation are highly regarded and beneficial contributions.
18+
19+
Finally, one of the most impactful ways to support us is by raising awareness about LLM Compressor and the vLLM community.
20+
Talk about it in your blog posts, highlighting how it's driving your incredible projects.
21+
Express your support on Twitter if vLLM aids you, or simply offer your appreciation by starring our repository.
22+
23+
## Setup for development
24+
25+
### Install from source
26+
27+
```bash
28+
pip install -e ./[dev]
29+
```
30+
31+
### Code Styling and Formatting checks
32+
33+
```bash
34+
make style
35+
make quality
36+
```
37+
38+
### Testing
39+
40+
```bash
41+
make test
42+
```
43+
44+
## Contributing Guidelines
45+
46+
### Issue Reporting
47+
48+
If you encounter a bug or have a feature request, please check our issues page first to see if someone else has already reported it.
49+
If not, please file a new issue, providing as much relevant information as possible.
50+
51+
### Pull Requests & Code Reviews
52+
53+
Please check the PR checklist in the [PR template](.github/PULL_REQUEST_TEMPLATE.md) for detailed guide for contribution.
54+
55+
### Thank You
56+
57+
Finally, thank you for taking the time to read these guidelines and for your interest in contributing to LLM Compressor.
58+
Your contributions make LLM Compressor a great tool for everyone!

docs/developer/developing.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
title: Development Guide
3+
weight: -6
4+
---
5+
6+
# Developing LLM Compressor
7+
8+
LLM Compressor is developed and tested using Python 3.8-3.11.
9+
To develop LLM Compressor, you will also need the development dependencies and to follow the styling guidelines.
10+
11+
Here are some details to get started.
12+
13+
## Basic Commands
14+
15+
**Development Installation**
16+
17+
```bash
18+
git clone https://github.com/vllm-project/llm-compressor
19+
cd llm-compressor
20+
python3 -m pip install -e "./[dev]"
21+
```
22+
23+
This will clone the LLM Compressor repo, install it, and install the development dependencies.
24+
25+
**Code Styling and Formatting checks**
26+
27+
```bash
28+
make style
29+
make quality
30+
```
31+
32+
This will run automatic code styling using `ruff`, `flake8`, `black`, and `isort` to test that the
33+
repository's code matches its standards.
34+
35+
**EXAMPLE: test changes locally**
36+
37+
```bash
38+
make test
39+
```
40+
41+
This will run the targeted LLM Compressor unit tests for the frameworks specified.
42+
43+
File any error found before changes as an Issue and fix any errors found after making changes before submitting a Pull Request.
44+
45+
## GitHub Workflow
46+
47+
1. Fork the `llm-compressor` repository into your GitHub account: https://github.com/vllm-project/llm-compressor.
48+
49+
2. Clone your fork of the GitHub repository, replacing `<username>` with your GitHub username.
50+
51+
Use ssh (recommended):
52+
53+
```bash
54+
git clone [email protected]:<username>/llm-compressor.git
55+
```
56+
57+
Or https:
58+
59+
```bash
60+
git clone https://github.com/<username>/llm-compressor.git
61+
```
62+
63+
3. Add a remote to keep up with upstream changes.
64+
65+
```bash
66+
git remote add upstream https://github.com/vllm-project/llm-compressor.git
67+
```
68+
69+
If you already have a copy, fetch upstream changes.
70+
71+
```bash
72+
git fetch upstream
73+
```
74+
75+
4. Create a feature branch to work in.
76+
77+
```bash
78+
git checkout -b feature-xxx upstream/main
79+
```
80+
81+
5. Work in your feature branch.
82+
83+
```bash
84+
git commit -a
85+
```
86+
87+
6. Periodically rebase your changes
88+
89+
```bash
90+
git pull --rebase
91+
```
92+
93+
7. When done, combine ("squash") related commits into a single one
94+
95+
```bash
96+
git rebase -i upstream/main
97+
```
98+
99+
This will open your editor and allow you to re-order commits and merge them:
100+
- Re-order the lines to change commit order (to the extent possible without creating conflicts)
101+
- Prefix commits using `s` (squash) or `f` (fixup) to merge extraneous commits.
102+
103+
8. Submit a pull-request
104+
105+
```bash
106+
git push origin feature-xxx
107+
```
108+
109+
Go to your fork main page
110+
111+
```bash
112+
https://github.com/<username>/llm-compressor
113+
```
114+
115+
If you recently pushed your changes GitHub will automatically pop up a `Compare & pull request` button for any branches you recently pushed to. If you click that button it will automatically offer you to submit your pull-request to the `vllm-project/llm-compressor` repository.
116+
117+
- Give your pull-request a meaningful title.
118+
You'll know your title is properly formatted once the `Semantic Pull Request` GitHub check
119+
transitions from a status of "pending" to "passed".
120+
- In the description, explain your changes and the problem they are solving.
121+
122+
9. Addressing code review comments
123+
124+
Repeat steps 5. through 7. to address any code review comments and rebase your changes if necessary.
125+
126+
Push your updated changes to update the pull request
127+
128+
```bash
129+
git push origin [--force] feature-xxx
130+
```
131+
132+
`--force` may be necessary to overwrite your existing pull request in case your
133+
commit history was changed when performing the rebase.
134+
135+
Note: Be careful when using `--force` since you may lose data if you are not careful.
136+
137+
```bash
138+
git push origin --force feature-xxx
139+
```

docs/examples/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
weight: -4
33
---
44

5-
# Examples
5+
# LLM Compressor examples
66

7-
Welcome to the LLM Compressor examples section! Here, you'll find practical demonstrations showing how to use LLM Compressor to optimize large language models for faster and more efficient deployment with vLLM. These examples will help you understand the various compression techniques and functionalities available in LLM Compressor, making it easier to apply them to your own models.
7+
This section provides practical demonstrations showing how to use LLM Compressor to optimize large language models for faster and more efficient deployment with vLLM. These examples will help you understand the various compression techniques and functionalities available in LLM Compressor, making it easier to apply them to your own models.
88

9-
To explore the examples, you can either navigate through the list provided in the sidebar or click next to see the next example in the series. Each example is designed to be self-contained, with clear instructions and code snippets that you can run directly.
9+
Each example is designed to be self-contained, with clear instructions and code snippets that you can run directly.

0 commit comments

Comments
 (0)