Skip to content

Conversation

@fffrog
Copy link
Collaborator

@fffrog fffrog commented Oct 17, 2025

Stack from ghstack (oldest at bottom):

Background:

pytest -s tests/test_autocast.py -vv

tests/test_autocast.py::TestAutocastoOpenReg::test_openreg_autocast_float16_supported /home/coder/code/pytorch/torch/_dynamo/eval_frame.py:1037: UserWarning: Set seed for `openreg` device does not take effect, please add API's `_is_in_bad_fork` and `manual_seed_all` to `openreg` device module.

Therefore, we need to add _is_in_bad_fork to OpenReg.

In addition, the OpenReg backend uses the CPU to simulate multi-threaded implementations of Stream and Event, so fork prevention is indeed necessary after initialization.

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 17, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/165728

Note: Links to docs will display an error until the docs builds have been completed.

❌ 3 New Failures

As of commit 2592d5e with merge base 4295a9a (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Oct 17, 2025
fffrog added a commit that referenced this pull request Oct 17, 2025
**Background**:

```bash
pytest -s tests/test_autocast.py -vv

tests/test_autocast.py::TestAutocastoOpenReg::test_openreg_autocast_float16_supported /home/coder/code/pytorch/torch/_dynamo/eval_frame.py:1037: UserWarning: Set seed for `openreg` device does not take effect, please add API's `_is_in_bad_fork` and `manual_seed_all` to `openreg` device module.
```

Therefore, we need to add `_is_in_bad_fork` to OpenReg.

In addition, the OpenReg backend uses the CPU to simulate multi-threaded implementations of Stream and Event, so fork prevention is indeed necessary after initialization.


ghstack-source-id: 1e6a255
Pull-Request: #165728
@fffrog fffrog requested a review from albanD October 17, 2025 04:21
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great!

Tests and a couple lines in the user guide about this would be great.

@fffrog
Copy link
Collaborator Author

fffrog commented Oct 21, 2025

Tests and a couple lines in the user guide about this would be great.

Thank you for helpful comments.

I will add tests for this changes right now, and the docs will be added in the later PR that are developed by other contributors.

[ghstack-poisoned]
fffrog added a commit that referenced this pull request Oct 26, 2025
**Background**:

```bash
pytest -s tests/test_autocast.py -vv

tests/test_autocast.py::TestAutocastoOpenReg::test_openreg_autocast_float16_supported /home/coder/code/pytorch/torch/_dynamo/eval_frame.py:1037: UserWarning: Set seed for `openreg` device does not take effect, please add API's `_is_in_bad_fork` and `manual_seed_all` to `openreg` device module.
```

Therefore, we need to add `_is_in_bad_fork` to OpenReg.

In addition, the OpenReg backend uses the CPU to simulate multi-threaded implementations of Stream and Event, so fork prevention is indeed necessary after initialization.

ghstack-source-id: 0413a98
Pull-Request: #165728
[ghstack-poisoned]
fffrog added a commit that referenced this pull request Oct 26, 2025
**Background**:

```bash
pytest -s tests/test_autocast.py -vv

tests/test_autocast.py::TestAutocastoOpenReg::test_openreg_autocast_float16_supported /home/coder/code/pytorch/torch/_dynamo/eval_frame.py:1037: UserWarning: Set seed for `openreg` device does not take effect, please add API's `_is_in_bad_fork` and `manual_seed_all` to `openreg` device module.
```

Therefore, we need to add `_is_in_bad_fork` to OpenReg.

In addition, the OpenReg backend uses the CPU to simulate multi-threaded implementations of Stream and Event, so fork prevention is indeed necessary after initialization.

ghstack-source-id: bd85439
Pull-Request: #165728
@fffrog
Copy link
Collaborator Author

fffrog commented Oct 26, 2025

Tests and a couple lines in the user guide about this would be great.

Hey @albanD, so sorry for the late commit

I have added test case related posion fork, please take a look at it.

Thank you.

@fffrog
Copy link
Collaborator Author

fffrog commented Oct 26, 2025

#166256, which can lead to something wrong for openreg.

[ghstack-poisoned]
fffrog added a commit that referenced this pull request Oct 26, 2025
**Background**:

```bash
pytest -s tests/test_autocast.py -vv

tests/test_autocast.py::TestAutocastoOpenReg::test_openreg_autocast_float16_supported /home/coder/code/pytorch/torch/_dynamo/eval_frame.py:1037: UserWarning: Set seed for `openreg` device does not take effect, please add API's `_is_in_bad_fork` and `manual_seed_all` to `openreg` device module.
```

Therefore, we need to add `_is_in_bad_fork` to OpenReg.

In addition, the OpenReg backend uses the CPU to simulate multi-threaded implementations of Stream and Event, so fork prevention is indeed necessary after initialization.

ghstack-source-id: d6b5e37
Pull-Request: #165728
[ghstack-poisoned]
fffrog added a commit that referenced this pull request Oct 27, 2025
**Background**:

```bash
pytest -s tests/test_autocast.py -vv

tests/test_autocast.py::TestAutocastoOpenReg::test_openreg_autocast_float16_supported /home/coder/code/pytorch/torch/_dynamo/eval_frame.py:1037: UserWarning: Set seed for `openreg` device does not take effect, please add API's `_is_in_bad_fork` and `manual_seed_all` to `openreg` device module.
```

Therefore, we need to add `_is_in_bad_fork` to OpenReg.

In addition, the OpenReg backend uses the CPU to simulate multi-threaded implementations of Stream and Event, so fork prevention is indeed necessary after initialization.

ghstack-source-id: 3dba2dd
Pull-Request: #165728
@fffrog fffrog requested a review from ezyang October 30, 2025 15:43
@ezyang
Copy link
Contributor

ezyang commented Oct 30, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 30, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants