Skip to content

[ray] fix: make spawn worker group hold strong reference to actors#1443

Merged
wuxibin89 merged 1 commit intomainfrom
wuxibin/fix_wg_ref
May 8, 2025
Merged

[ray] fix: make spawn worker group hold strong reference to actors#1443
wuxibin89 merged 1 commit intomainfrom
wuxibin/fix_wg_ref

Conversation

@wuxibin89
Copy link
Copy Markdown
Collaborator

Checklist Before Starting

  • Search for similar PR(s).

What does this PR do?

Spawned RayWorkerGroup get actors by name, which holds a weak reference to the actor and causes actors garbage collected unexpectedly. Pass actor handle explicitly in spawn to make RayWorkerGroup have strong reference to these actors. close #1365 #1138 (comment)

High-Level Design

Demonstrate the high-level design if this PR is complex.

Specific Changes

List the specific changes.

API

Demonstrate how the API changes if any.

Usage Example

Provide usage example(s) for easier usage.

# Add code snippet or script demonstrating how to use this 

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluatuion results, etc.

Additional Info.

  • Issue Number: Fixes issue # or discussion # if any.
  • Training: [Note which backend this PR will affect: FSDP, Megatron, both, or none]
  • Inference: [Note which backend this PR will affect: vLLM, SGLang, both, or none]

Checklist Before Submitting

  • Read the Contribute Guide.
  • Apply pre-commit checks.
  • Add [BREAKING] to the PR title if it breaks any API.
  • Update the documentation about your changes in the docs.
  • Add CI test(s) if neccessary.

@wuxibin89 wuxibin89 merged commit f90b717 into main May 8, 2025
32 of 33 checks passed
@wuxibin89 wuxibin89 deleted the wuxibin/fix_wg_ref branch May 8, 2025 15:08
vermouth1992 pushed a commit that referenced this pull request Jun 4, 2025
…refix=None)` (#1838)

### Checklist Before Starting

- [x] Search for similar PR(s).

### What does this PR do?

In #1443, a new argument `name_prefix` was introduced for function
`from_detached` without setting a default value. This PR sets its
default value as `None`, in which case, `RayWorkerGroup` will generate a
random string as the prefix. This fix makes the API compatible with
existing usage, and the users don't need to worry about this new args
when a `name_prefix` is not not context necessary.

### Checklist Before Submitting

- [x] Read the [Contribute
Guide](https://github.com/volcengine/verl?tab=readme-ov-file#contribution-guide).
- [x] Apply [pre-commit
checks](https://github.com/volcengine/verl?tab=readme-ov-file#code-linting-and-formatting).
- [ ] Add `[BREAKING]` to the PR title if it breaks any API.
- [ ] Update the documentation about your changes in the
[docs](https://github.com/volcengine/verl/tree/main/docs).
- [ ] New CI unit test(s) are added to cover the code path.
- [x] Rely on existing unit tests on CI that covers the code path.

Signed-off-by: Hongpeng Guo <hg5@illinois.edu>
yellowbee686 pushed a commit to yellowbee686/verl that referenced this pull request Jun 6, 2025
…refix=None)` (verl-project#1838)

### Checklist Before Starting

- [x] Search for similar PR(s).

### What does this PR do?

In verl-project#1443, a new argument `name_prefix` was introduced for function
`from_detached` without setting a default value. This PR sets its
default value as `None`, in which case, `RayWorkerGroup` will generate a
random string as the prefix. This fix makes the API compatible with
existing usage, and the users don't need to worry about this new args
when a `name_prefix` is not not context necessary.

### Checklist Before Submitting

- [x] Read the [Contribute
Guide](https://github.com/volcengine/verl?tab=readme-ov-file#contribution-guide).
- [x] Apply [pre-commit
checks](https://github.com/volcengine/verl?tab=readme-ov-file#code-linting-and-formatting).
- [ ] Add `[BREAKING]` to the PR title if it breaks any API.
- [ ] Update the documentation about your changes in the
[docs](https://github.com/volcengine/verl/tree/main/docs).
- [ ] New CI unit test(s) are added to cover the code path.
- [x] Rely on existing unit tests on CI that covers the code path.

Signed-off-by: Hongpeng Guo <hg5@illinois.edu>
wwwjn pushed a commit to wwwjn/verl that referenced this pull request Jun 10, 2025
…refix=None)` (verl-project#1838)

### Checklist Before Starting

- [x] Search for similar PR(s).

### What does this PR do?

In verl-project#1443, a new argument `name_prefix` was introduced for function
`from_detached` without setting a default value. This PR sets its
default value as `None`, in which case, `RayWorkerGroup` will generate a
random string as the prefix. This fix makes the API compatible with
existing usage, and the users don't need to worry about this new args
when a `name_prefix` is not not context necessary.

### Checklist Before Submitting

- [x] Read the [Contribute
Guide](https://github.com/volcengine/verl?tab=readme-ov-file#contribution-guide).
- [x] Apply [pre-commit
checks](https://github.com/volcengine/verl?tab=readme-ov-file#code-linting-and-formatting).
- [ ] Add `[BREAKING]` to the PR title if it breaks any API.
- [ ] Update the documentation about your changes in the
[docs](https://github.com/volcengine/verl/tree/main/docs).
- [ ] New CI unit test(s) are added to cover the code path.
- [x] Rely on existing unit tests on CI that covers the code path.

Signed-off-by: Hongpeng Guo <hg5@illinois.edu>
chenjiaoAngel added a commit to chenjiaoAngel/verl that referenced this pull request Nov 14, 2025
…erl-project#1443)

### Checklist Before Starting

- [ ] Search for similar PR(s).

### What does this PR do?

Spawned RayWorkerGroup get actors by name, which holds a weak reference
to the actor and causes actors garbage collected unexpectedly. Pass
actor handle explicitly in spawn to make RayWorkerGroup have strong
reference to these actors. close verl-project#1365
verl-project#1138 (comment)

### High-Level Design

> Demonstrate the high-level design if this PR is complex.

### Specific Changes

> List the specific changes.

### API

> Demonstrate how the API changes if any.

### Usage Example

> Provide usage example(s) for easier usage.

```python
# Add code snippet or script demonstrating how to use this 
```

### Test

> For changes that can not be tested by CI (e.g., algorithm
implementation, new model support), validate by experiment(s) and show
results like training curve plots, evaluatuion results, etc.

### Additional Info.

- **Issue Number**: Fixes issue # or discussion # if any.
- **Training**: [Note which backend this PR will affect: FSDP, Megatron,
both, or none]
- **Inference**: [Note which backend this PR will affect: vLLM, SGLang,
both, or none]

### Checklist Before Submitting

- [ ] Read the [Contribute
Guide](https://github.com/volcengine/verl?tab=readme-ov-file#contribution-guide).
- [ ] Apply [pre-commit
checks](https://github.com/volcengine/verl?tab=readme-ov-file#code-linting-and-formatting).
- [ ] Add `[BREAKING]` to the PR title if it breaks any API.
- [ ] Update the documentation about your changes in the
[docs](https://github.com/volcengine/verl/tree/main/docs).
- [ ] Add CI test(s) if neccessary.
chenjiaoAngel added a commit to chenjiaoAngel/verl that referenced this pull request Nov 14, 2025
…refix=None)` (verl-project#1838)

### Checklist Before Starting

- [x] Search for similar PR(s).

### What does this PR do?

In verl-project#1443, a new argument `name_prefix` was introduced for function
`from_detached` without setting a default value. This PR sets its
default value as `None`, in which case, `RayWorkerGroup` will generate a
random string as the prefix. This fix makes the API compatible with
existing usage, and the users don't need to worry about this new args
when a `name_prefix` is not not context necessary.

### Checklist Before Submitting

- [x] Read the [Contribute
Guide](https://github.com/volcengine/verl?tab=readme-ov-file#contribution-guide).
- [x] Apply [pre-commit
checks](https://github.com/volcengine/verl?tab=readme-ov-file#code-linting-and-formatting).
- [ ] Add `[BREAKING]` to the PR title if it breaks any API.
- [ ] Update the documentation about your changes in the
[docs](https://github.com/volcengine/verl/tree/main/docs).
- [ ] New CI unit test(s) are added to cover the code path.
- [x] Rely on existing unit tests on CI that covers the code path.

Signed-off-by: Hongpeng Guo <hg5@illinois.edu>
TimurTaepov pushed a commit to giorgossideris/verl that referenced this pull request Dec 20, 2025
…erl-project#1443)

### Checklist Before Starting

- [ ] Search for similar PR(s).

### What does this PR do?

Spawned RayWorkerGroup get actors by name, which holds a weak reference
to the actor and causes actors garbage collected unexpectedly. Pass
actor handle explicitly in spawn to make RayWorkerGroup have strong
reference to these actors. close verl-project#1365
verl-project#1138 (comment)

### High-Level Design

> Demonstrate the high-level design if this PR is complex.

### Specific Changes

> List the specific changes.

### API

> Demonstrate how the API changes if any.

### Usage Example

> Provide usage example(s) for easier usage.

```python
# Add code snippet or script demonstrating how to use this 
```

### Test

> For changes that can not be tested by CI (e.g., algorithm
implementation, new model support), validate by experiment(s) and show
results like training curve plots, evaluatuion results, etc.

### Additional Info.

- **Issue Number**: Fixes issue # or discussion # if any.
- **Training**: [Note which backend this PR will affect: FSDP, Megatron,
both, or none]
- **Inference**: [Note which backend this PR will affect: vLLM, SGLang,
both, or none]

### Checklist Before Submitting

- [ ] Read the [Contribute
Guide](https://github.com/volcengine/verl?tab=readme-ov-file#contribution-guide).
- [ ] Apply [pre-commit
checks](https://github.com/volcengine/verl?tab=readme-ov-file#code-linting-and-formatting).
- [ ] Add `[BREAKING]` to the PR title if it breaks any API.
- [ ] Update the documentation about your changes in the
[docs](https://github.com/volcengine/verl/tree/main/docs).
- [ ] Add CI test(s) if neccessary.
TimurTaepov pushed a commit to giorgossideris/verl that referenced this pull request Dec 20, 2025
…refix=None)` (verl-project#1838)

### Checklist Before Starting

- [x] Search for similar PR(s).

### What does this PR do?

In verl-project#1443, a new argument `name_prefix` was introduced for function
`from_detached` without setting a default value. This PR sets its
default value as `None`, in which case, `RayWorkerGroup` will generate a
random string as the prefix. This fix makes the API compatible with
existing usage, and the users don't need to worry about this new args
when a `name_prefix` is not not context necessary.

### Checklist Before Submitting

- [x] Read the [Contribute
Guide](https://github.com/volcengine/verl?tab=readme-ov-file#contribution-guide).
- [x] Apply [pre-commit
checks](https://github.com/volcengine/verl?tab=readme-ov-file#code-linting-and-formatting).
- [ ] Add `[BREAKING]` to the PR title if it breaks any API.
- [ ] Update the documentation about your changes in the
[docs](https://github.com/volcengine/verl/tree/main/docs).
- [ ] New CI unit test(s) are added to cover the code path.
- [x] Rely on existing unit tests on CI that covers the code path.

Signed-off-by: Hongpeng Guo <hg5@illinois.edu>
vyomakesh0728 added a commit to vyomakesh0728/verl that referenced this pull request Jan 22, 2026
…erl-project#1443)

### Checklist Before Starting

- [ ] Search for similar PR(s).

### What does this PR do?

Spawned RayWorkerGroup get actors by name, which holds a weak reference
to the actor and causes actors garbage collected unexpectedly. Pass
actor handle explicitly in spawn to make RayWorkerGroup have strong
reference to these actors. close verl-project#1365
verl-project#1138 (comment)

### High-Level Design

> Demonstrate the high-level design if this PR is complex.

### Specific Changes

> List the specific changes.

### API

> Demonstrate how the API changes if any.

### Usage Example

> Provide usage example(s) for easier usage.

```python
# Add code snippet or script demonstrating how to use this 
```

### Test

> For changes that can not be tested by CI (e.g., algorithm
implementation, new model support), validate by experiment(s) and show
results like training curve plots, evaluatuion results, etc.

### Additional Info.

- **Issue Number**: Fixes issue # or discussion # if any.
- **Training**: [Note which backend this PR will affect: FSDP, Megatron,
both, or none]
- **Inference**: [Note which backend this PR will affect: vLLM, SGLang,
both, or none]

### Checklist Before Submitting

- [ ] Read the [Contribute
Guide](https://github.com/volcengine/verl?tab=readme-ov-file#contribution-guide).
- [ ] Apply [pre-commit
checks](https://github.com/volcengine/verl?tab=readme-ov-file#code-linting-and-formatting).
- [ ] Add `[BREAKING]` to the PR title if it breaks any API.
- [ ] Update the documentation about your changes in the
[docs](https://github.com/volcengine/verl/tree/main/docs).
- [ ] Add CI test(s) if neccessary.
vyomakesh0728 added a commit to vyomakesh0728/verl that referenced this pull request Jan 22, 2026
…refix=None)` (verl-project#1838)

### Checklist Before Starting

- [x] Search for similar PR(s).

### What does this PR do?

In verl-project#1443, a new argument `name_prefix` was introduced for function
`from_detached` without setting a default value. This PR sets its
default value as `None`, in which case, `RayWorkerGroup` will generate a
random string as the prefix. This fix makes the API compatible with
existing usage, and the users don't need to worry about this new args
when a `name_prefix` is not not context necessary.

### Checklist Before Submitting

- [x] Read the [Contribute
Guide](https://github.com/volcengine/verl?tab=readme-ov-file#contribution-guide).
- [x] Apply [pre-commit
checks](https://github.com/volcengine/verl?tab=readme-ov-file#code-linting-and-formatting).
- [ ] Add `[BREAKING]` to the PR title if it breaks any API.
- [ ] Update the documentation about your changes in the
[docs](https://github.com/volcengine/verl/tree/main/docs).
- [ ] New CI unit test(s) are added to cover the code path.
- [x] Rely on existing unit tests on CI that covers the code path.

Signed-off-by: Hongpeng Guo <hg5@illinois.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-Turn Rollout on a single GPU

2 participants