Skip to content

Commit f7e47d6

Browse files
authored
[readme] update readme (#29)
* update readme * fix deps
1 parent bfeb4d5 commit f7e47d6

File tree

8 files changed

+255
-11
lines changed

8 files changed

+255
-11
lines changed

.github/CODE_OF_CONDUCT.md

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

.github/CONTRIBUTING.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Contributing to EasyR1
2+
3+
Everyone is welcome to contribute, and we value everybody's contribution. Code contributions are not the only way to help the community. Answering questions, helping others, and improving the documentation are also immensely valuable.
4+
5+
It also helps us if you spread the word! Reference the library in blog posts about the awesome projects it made possible, shout out on Twitter every time it has helped you, or simply ⭐️ the repository to say thank you.
6+
7+
However you choose to contribute, please be mindful and respect our [code of conduct](CODE_OF_CONDUCT.md).
8+
9+
**This guide was heavily inspired by [transformers guide to contributing](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md).**
10+
11+
## Ways to contribute
12+
13+
There are several ways you can contribute to EasyR1:
14+
15+
* Fix outstanding issues with the existing code.
16+
* Submit issues related to bugs or desired new features.
17+
* Contribute to the examples or to the documentation.
18+
19+
### Style guide
20+
21+
EasyR1 follows the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html), check it for details.
22+
23+
### Create a Pull Request
24+
25+
1. Fork the [repository](https://github.com/hiyouga/EasyR1) by clicking on the [Fork](https://github.com/hiyouga/EasyR1/fork) button on the repository's page. This creates a copy of the code under your GitHub user account.
26+
27+
2. Clone your fork to your local disk, and add the base repository as a remote:
28+
29+
```bash
30+
git clone [email protected]:[username]/EasyR1.git
31+
cd EasyR1
32+
git remote add upstream https://github.com/hiyouga/EasyR1.git
33+
```
34+
35+
3. Create a new branch to hold your development changes:
36+
37+
```bash
38+
git checkout -b dev_your_branch
39+
```
40+
41+
4. Set up a development environment by running the following command in a virtual environment:
42+
43+
```bash
44+
pip install -e ".[dev]"
45+
```
46+
47+
5. Check code before commit:
48+
49+
```bash
50+
make commit
51+
make style && make quality
52+
```
53+
54+
6. Submit changes:
55+
56+
```bash
57+
git add .
58+
git commit -m "commit message"
59+
git fetch upstream
60+
git rebase upstream/main
61+
git push -u origin dev_your_branch
62+
```
63+
64+
7. Create a merge request from your branch `dev_your_branch` at [origin repo](https://github.com/hiyouga/EasyR1).

.github/workflows/tests.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
paths:
8+
- "**.py"
9+
- "requirements.txt"
10+
- ".github/workflows/*.yml"
11+
pull_request:
12+
branches:
13+
- "main"
14+
paths:
15+
- "**.py"
16+
- "requirements.txt"
17+
- ".github/workflows/*.yml"
18+
19+
jobs:
20+
tests:
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
python-version:
25+
- "3.11"
26+
os:
27+
- "ubuntu-latest"
28+
29+
runs-on: ${{ matrix.os }}
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
cache: "pip"
40+
cache-dependency-path: "setup.py"
41+
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
python -m pip install ruff
46+
47+
- name: Check quality
48+
run: |
49+
make style && make quality

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ EasyR1 is efficient and scalable due to the design of **[HybirdEngine](https://a
2323
### Software Requirements
2424

2525
- Python 3.9+
26-
- Pytorch 2.4.0+
27-
- Transformers 4.49.0+
28-
- flash-attn
29-
- vLLM 0.7.3+
26+
- transformers>=4.49.0
27+
- flash-attn>=2.4.3
28+
- vllm>=0.7.3
3029

3130
We provide a [Dockerfile](./Dockerfile) to easily build environments.
3231

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "verl"
7-
dynamic = ["version", "readme", "license"]
7+
dynamic = ["version", "dependencies", "optional-dependencies", "readme", "license"]
88
requires-python = ">=3.8"
99

1010
[tool.ruff]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
accelerate
22
codetiming
33
datasets
4-
flash-attn
4+
flash-attn>=2.4.3
55
liger-kernel
66
numpy
77
omegaconf

setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ def get_requires():
2323
return lines
2424

2525

26+
extra_require = {
27+
"dev": ["pre-commit", "ruff"],
28+
}
29+
30+
2631
def main():
2732
setup(
2833
name="verl",
@@ -35,6 +40,7 @@ def main():
3540
3641
description="",
3742
install_requires=get_requires(),
43+
extras_require=extra_require,
3844
long_description=open("README.md", encoding="utf-8").read(),
3945
long_description_content_type="text/markdown",
4046
)

verl/workers/rollout/vllm_rollout/vllm_rollout_spmd.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,13 @@ def __init__(self, model_path: str, config: RolloutConfig, tokenizer: PreTrained
5858
if not config.enforce_eager and config.free_cache_engine:
5959
raise ValueError("CUDA graph should be disabled when `free_cache_engine` is True.")
6060

61+
if config.max_num_batched_tokens < config.prompt_length + config.response_length:
62+
raise ValueError("max_num_batched_tokens should be greater than prompt_length + response_length.")
63+
6164
vllm_init_kwargs = {}
6265
if config.limit_images > 0:
6366
vllm_init_kwargs = {"limit_mm_per_prompt": {"image": config.limit_images}}
6467

65-
66-
if config.max_num_batched_tokens < config.prompt_length + config.response_length:
67-
raise ValueError("max_num_batched_tokens should be greater than prompt_length + response_length. \
68-
Please set/modify the rollout.max_num_batched_tokens、data.max_prompt_length、data.max_response_length in the config yaml ")
69-
7068
self.inference_engine = LLM(
7169
model=model_path,
7270
skip_tokenizer_init=False,

0 commit comments

Comments
 (0)