Allow StridedMemoryView to be constructed from dlpacks type code#1623
Allow StridedMemoryView to be constructed from dlpacks type code#1623Andy-Jost merged 8 commits intoNVIDIA:mainfrom
StridedMemoryView to be constructed from dlpacks type code#1623Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
StridedMemoryView to be constructed from dlpacks type code/home/wangm/.pixi/bin/pixi shell --manifest-path /home/wangm/numba-cuda-fp8/pixi.toml --environment cu-13-0-py312StridedMemoryView to be constructed from dlpacks type code
cpcloud
left a comment
There was a problem hiding this comment.
Looks good except for the torch testing input.
| try: | ||
| import torch | ||
| except ImportError: | ||
| torch = None |
There was a problem hiding this comment.
This should really use pytest.importorskip inside your test. The current pattern is definitely an anti-pattern.
There was a problem hiding this comment.
I think this one is fine, since it matches the style in this file (and a few other places).
There was a problem hiding this comment.
Can probably leave a TODO here for a general refactoring.
There was a problem hiding this comment.
Definitely an anti pattern to address. We shouldn't just keep accumulating them. Not blocking.
|
@isVoid CuPy v14.0.0 is out and we are preparing to release cuda.core v0.6.0. Let's try to squeeze this in! |
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
UPDATE: Done. Just one more thing - I need to push some documentation addition. |
|
/ok to test 948cb4e |
|
|
/ok to test 2c746f1 |
|
/ok to test bcd291d |
Description
closes #1624
Patched dtype handler in
_memoryview.pyxto handle dlpack type code of kDLBfloat. Added tests to construct from an external object (currently, cupy) can communicate via dlpack bfloat16 type code.ml_dtypesis added as an optional dependency, whenml_dtypesisn't present, this code path should gracefully raise with readable error.Note: this still depends on
an unreleasednow released build of cupy (14.0.0). cupy/cupy#9670Checklist