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

[BUG]: TensoryMemory does not work with uint arrays #1619

Closed
2 tasks done
edknv opened this issue Apr 11, 2024 · 0 comments · Fixed by #1621
Closed
2 tasks done

[BUG]: TensoryMemory does not work with uint arrays #1619

edknv opened this issue Apr 11, 2024 · 0 comments · Fixed by #1621
Assignees
Labels
bug Something isn't working

Comments

@edknv
Copy link
Contributor

edknv commented Apr 11, 2024

Version

24.03

Which installation method(s) does this occur on?

branch-24.03

Describe the bug.

TensoryMemory does not seem to work with certain data types, e.g. uint8.

Minimum reproducible example

>>> import cupy as cp
>>> import numpy as np
>>> from morpheus._lib.messages import TensorMemory as CppTensorMemory
>>> array = np.array([[1, 2], [3, 4]], dtype=np.uint8)
>>> array = cp.asarray(array)
>>> CppTensorMemory(count=array.shape[0], tensors={"array": array})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: stoi

The same code does work if dtype is switched to int16.

>>> array = np.array([[1, 2], [3, 4]], dtype=np.int16)                                    
>>> array = cp.asarray(array)
>>> CppTensorMemory(count=array.shape[0], tensors={"array": array})
<morpheus._lib.messages.TensorMemory object at 0x7c309476aaf0>

Relevant log output

Click here to see error details

[Paste the error here, it will be hidden by default]

Full env printout

Click here to see environment details

[Paste the results of print_env.sh here, it will be hidden by default]

Other/Misc.

No response

Code of Conduct

  • I agree to follow Morpheus' Code of Conduct
  • I have searched the open bugs and have found no duplicates for this bug report
@edknv edknv added the bug Something isn't working label Apr 11, 2024
@efajardo-nv efajardo-nv self-assigned this Apr 11, 2024
@jarmak-nv jarmak-nv moved this from Todo to Review - Ready for Review in Morpheus Boards Apr 11, 2024
rapids-bot bot pushed a commit that referenced this issue Apr 23, 2024
- Update to `DType::from_numpy` to handle strings that identify `uint8` and `int8` dtypes
- Add unit tests for DType
- Update to throw invalid argument exceptions on invalid numpy typestr's.

Closes #1619

## By Submitting this PR I confirm:
- I am familiar with the [Contributing Guidelines](https://github.com/nv-morpheus/Morpheus/blob/main/docs/source/developer_guide/contributing.md).
- When the PR is ready for review, new or existing tests cover these changes.
- When the PR is ready for review, the documentation is up to date with these changes.

Authors:
  - Eli Fajardo (https://github.com/efajardo-nv)

Approvers:
  - Michael Demoret (https://github.com/mdemoret-nv)

URL: #1621
@github-project-automation github-project-automation bot moved this from Review - Ready for Review to Done in Morpheus Boards Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants