Skip to content

Conversation

@HydrogenSulfate
Copy link
Contributor

@HydrogenSulfate HydrogenSulfate commented Mar 3, 2025

Same pr in numba/numba#9834(can be closed if this pr is merged)

we support paddle.Tensor.__cuda_array_interface__(PaddlePaddle/Paddle#68192) and paddle.to_tensor(tenosr_with_CAI_impl)(PaddlePaddle/Paddle#69913), so we can convert paddle Tensor from/to other DL frameworks via CAI(based on CAI version 2).

import paddle
import torch
import numpy as np


for i in range(10):
    pt_ten = torch.randn([3, 3], device="cuda:0")
    pd_ten = paddle.to_tensor(pt_ten)
    pd_ten[0, :] = paddle.randn([3])
    np.testing.assert_allclose(pd_ten.numpy(), pt_ten.detach().cpu().numpy())

@copy-pr-bot
Copy link

copy-pr-bot bot commented Mar 3, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@gmarkall
Copy link
Contributor

gmarkall commented Mar 3, 2025

Many thanks!

@gmarkall gmarkall merged commit 964248d into NVIDIA:main Mar 3, 2025
@HydrogenSulfate HydrogenSulfate deleted the add_paddle_in_doc branch March 4, 2025 02:33
gmarkall added a commit to gmarkall/numba-cuda that referenced this pull request Mar 6, 2025
- Fix linking of external code from callees (NVIDIA#137)
- Try using a newer branch workflow (NVIDIA#148)
- Move publish step out of `wheels-build.yaml` (NVIDIA#147)
- Upload wheels to PyPI from GitHub-hosted runner (NVIDIA#142)
- Add paddle to interoperability chapter (NVIDIA#144)
- Fix the debug info of GridGroup type (NVIDIA#131)
- Remove dead `prepare_cuda_kernel()` (NVIDIA#130)
- Add a CUDA DI Builder (NVIDIA#104)
- dont launch extra kernels when stats counting is disabled (NVIDIA#127)
- Fixup debug metadata in kernel fixup (NVIDIA#97)
- Implement debuginfo bool name fix (numba/numba#9888) in numba-cuda (NVIDIA#106)
@gmarkall gmarkall mentioned this pull request Mar 6, 2025
gmarkall added a commit that referenced this pull request Mar 6, 2025
- Fix linking of external code from callees (#137)
- Try using a newer branch workflow (#148)
- Move publish step out of `wheels-build.yaml` (#147)
- Upload wheels to PyPI from GitHub-hosted runner (#142)
- Add paddle to interoperability chapter (#144)
- Fix the debug info of GridGroup type (#131)
- Remove dead `prepare_cuda_kernel()` (#130)
- Add a CUDA DI Builder (#104)
- dont launch extra kernels when stats counting is disabled (#127)
- Fixup debug metadata in kernel fixup (#97)
- Implement debuginfo bool name fix (numba/numba#9888) in numba-cuda (#106)
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.

2 participants