Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sending images to the vscode extension fails, if the tensor is not local to the cpu #63

Merged
merged 5 commits into from
Apr 2, 2024

Conversation

WinPlay02
Copy link
Contributor

@WinPlay02 WinPlay02 commented Mar 31, 2024

Related-to: Safe-DS/DSL#954 (the PR requires this fix to work)

Fixes the following error:

RuntimeError: Attempted to send CUDA tensor received from another process; this is not currently supported. Consider cloning before sending.

This error only occurs on systems that support graphics acceleration of tensor operations.
On other systems, the tensor is local to the CPU by default and does not need to be converted.
The conversion process is a noop, if the tensor is already local to the CPU.

Copy link

github-actions bot commented Mar 31, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 2 0 0 0.78s
✅ PYTHON mypy 2 0 2.23s
✅ PYTHON ruff 2 0 0 0.03s
✅ REPOSITORY git_diff yes no 0.02s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Copy link

codecov bot commented Mar 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (14ff8cc) to head (6f55684).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #63   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        11           
  Lines          500       504    +4     
=========================================
+ Hits           500       504    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@WinPlay02 WinPlay02 marked this pull request as ready for review March 31, 2024 18:42
@WinPlay02 WinPlay02 requested a review from a team as a code owner March 31, 2024 18:42
@WinPlay02
Copy link
Contributor Author

@SmiteDeluxe The PR for the fix we talked about

lars-reimann
lars-reimann previously approved these changes Mar 31, 2024
Copy link
Member

@lars-reimann lars-reimann left a comment

Choose a reason for hiding this comment

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

The code looks good. I cannot currently verify, though, whether this fixes the issue. Still, feel free to merge if you've checked this.

@WinPlay02
Copy link
Contributor Author

The code looks good. I cannot currently verify, though, whether this fixes the issue. Still, feel free to merge if you've checked this.

As I'm not affected by this, @SmiteDeluxe would be able to verify and merge this

Copy link
Contributor

@SmiteDeluxe SmiteDeluxe left a comment

Choose a reason for hiding this comment

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

Working for me with this change!

@SmiteDeluxe SmiteDeluxe merged commit 8cf0b57 into main Apr 2, 2024
8 checks passed
@SmiteDeluxe SmiteDeluxe deleted the fix-non-cpu-tensor-image-extension-sending branch April 2, 2024 18:43
lars-reimann pushed a commit that referenced this pull request Apr 3, 2024
## [0.8.0](v0.7.0...v0.8.0) (2024-04-03)

### Features

* **deps:** bump safe-ds from 0.19.0 to 0.20.0 ([#74](#74)) ([86cccff](86cccff)), closes [#573](https://github.com/Safe-DS/Runner/issues/573) [#529](https://github.com/Safe-DS/Runner/issues/529) [#522](https://github.com/Safe-DS/Runner/issues/522) [#588](https://github.com/Safe-DS/Runner/issues/588) [#548](https://github.com/Safe-DS/Runner/issues/548) [#519](https://github.com/Safe-DS/Runner/issues/519) [#550](https://github.com/Safe-DS/Runner/issues/550) [#549](https://github.com/Safe-DS/Runner/issues/549) [#572](https://github.com/Safe-DS/Runner/issues/572) [#571](https://github.com/Safe-DS/Runner/issues/571) [#567](https://github.com/Safe-DS/Runner/issues/567) [#587](https://github.com/Safe-DS/Runner/issues/587) [#582](https://github.com/Safe-DS/Runner/issues/582) [#585](https://github.com/Safe-DS/Runner/issues/585) [#573](https://github.com/Safe-DS/Runner/issues/573) [#529](https://github.com/Safe-DS/Runner/issues/529) [#522](https://github.com/Safe-DS/Runner/issues/522) [#588](https://github.com/Safe-DS/Runner/issues/588) [#548](https://github.com/Safe-DS/Runner/issues/548) [#519](https://github.com/Safe-DS/Runner/issues/519) [#550](https://github.com/Safe-DS/Runner/issues/550) [#549](https://github.com/Safe-DS/Runner/issues/549) [#572](https://github.com/Safe-DS/Runner/issues/572) [#571](https://github.com/Safe-DS/Runner/issues/571) [#567](https://github.com/Safe-DS/Runner/issues/567) [#587](https://github.com/Safe-DS/Runner/issues/587) [#582](https://github.com/Safe-DS/Runner/issues/582) [#585](https://github.com/Safe-DS/Runner/issues/585) [#605](https://github.com/Safe-DS/Runner/issues/605) [#604](https://github.com/Safe-DS/Runner/issues/604) [#603](https://github.com/Safe-DS/Runner/issues/603) [#593](https://github.com/Safe-DS/Runner/issues/593) [#598](https://github.com/Safe-DS/Runner/issues/598) [#595](https://github.com/Safe-DS/Runner/issues/595) [#594](https://github.com/Safe-DS/Runner/issues/594) [#591](https://github.com/Safe-DS/Runner/issues/591) [#590](https://github.com/Safe-DS/Runner/issues/590)

### Bug Fixes

* sending images to the vscode extension fails, if the tensor is not local to the cpu ([#63](#63)) ([8cf0b57](8cf0b57))

### Performance Improvements

* faster startup ([#55](#55)) ([a3fbe24](a3fbe24))
@lars-reimann
Copy link
Member

🎉 This PR is included in version 0.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Apr 3, 2024
lars-reimann added a commit to Safe-DS/DSL that referenced this pull request Apr 6, 2024
Closes #929 

### Summary of Changes

Communication from EDA -> Runner in own file that allows appending of
code to the executed pipeline to get and generate new info.
This results in full profiling being done already, fetched when needed
and displayed in webview.
Also includes start of from webview triggered actions that append code,
in the form of filters. But this is to be picked up in new issue.

Other changes include refactorings and fixes for visual and edge case
bugs.

### Important to run this:
Some environments might need a change in the runner for images (plots)
to work, that will be pushed to the Runner repo in PR
Safe-DS/Runner#63.

To PipelineManager:
```
from safeds.data.image.containers import Image
import torch
```
To beginning of save_placeholder method:
```
if isinstance(value, Image):
    value = Image(value._image_tensor, torch.device("cpu"))
```

---------

Co-authored-by: Lars Reimann <[email protected]>
Co-authored-by: WinPlay02 <[email protected]>
Co-authored-by: megalinter-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Included in a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants