ROCm / pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration
http://pytorch.org
Other
219 stars 50 forks source link

Why don't we have a PyTorch-ROCM pip package like tensorflow? #327

Open iamkucuk opened 5 years ago

iamkucuk commented 5 years ago

🚀 Feature

PyTorch ROCM package as a pip package like tensorflow-rocm would be great.

Motivation

While it is already a pain for newer users to get things up and running, pytorch installation for rocm platform is just a lot for newer users. Since there is a tensorflow-rocm package for new users to easily download and install, I think PyTorch should have it too for the users who prefer pytorch over tensorflow.

Pitch

PyTorch ROCM package as a pip package like tensorflow-rocm would be great.

Alternatives

A conda package would be great too

iotamudelta commented 5 years ago

We are working on making this happen with upstream. Thanks for your request!

iamkucuk commented 5 years ago

We are working on making this happen with upstream. Thanks for your request!

I know you guys hate this question but it's kinda urgent so please forgive me for asking this:

Can you give any kind of eta for upstream?

Thanks for answering.

iotamudelta commented 5 years ago

We have upstreamed all ROCm enablement already. You can use the upstream repository on top of ROCm. Concerning the pip wheel: since that's outside our hands, unfortunately not.

In the meantime, I'd like to recommend our pre-build docker for Vega10, see https://github.com/ROCmSoftwarePlatform/pytorch/wiki/Running-PyTorch-on-ROCm . It's not quite as easy as a pip wheel but has the advantage that it comes with all ROCm dependencies bundled.

iamkucuk commented 5 years ago

We have upstreamed all ROCm enablement already. You can use the upstream repository on top of ROCm. Concerning the pip wheel: since that's outside our hands, unfortunately not.

In the meantime, I'd like to recommend our pre-build docker for Vega10, see https://github.com/ROCmSoftwarePlatform/pytorch/wiki/Running-PyTorch-on-ROCm . It's not quite as easy as a pip wheel but has the advantage that it comes with all ROCm dependencies bundled.

Even projects with 0 stars can be easily located in PyPi packages and installed via pip. But if you say it's not a thing the huge Rocm community cannot do, please forgive me I have a hard time to understand this.

I struggled 4 hours with docker images and containers last night. Can you please point out a tutorial how to work with docker containers with an IDE? I couldn't manage to get autocorrect work and I couldn't use the packages I installed using pip.

briansp2020 commented 5 years ago

docker exec -it -e DISPLAY=${DISPLAY} gracious_greider bash gracious_greider is my container name. -e DISPLAY=${DISPLAY} option allows the applications inside docker to display on your local GUI. After executing bash that way, just launch your IDE from within docker and it will display on your screen.

iamkucuk commented 5 years ago

docker exec -it -e DISPLAY=${DISPLAY} gracious_greider bash gracious_greider is my container name. -e DISPLAY=${DISPLAY} option allows the applications inside docker to display on your local GUI. After executing bash that way, just launch your IDE from within docker and it will display on your screen.

I couldn't manage to install an IDE into the container. However, I could manage to use the docker image as interpreter with PyCharm. Now here's where I got stuck; I need to install additional packages with pip. However, as far as I understood, pip installations (or any kind of installations) in containers are not persistent. I tried to install whatever I want and build a new docker image with it and use it as the image I use for the interpreter container. It was a partial success. Oddly, the interpreter paths shows as empty with the newly created image. And because of that reason, IDE features like autocomplete is not working with the new image.

briansp2020 commented 5 years ago

docker image does not persist your changes unless you tag it. However, you don't have to start your docker instance from an image every time. docker run will run a container from an image. Hover, once you have a running container, it will persist whatever changes you make until you remove it. what do you see when you run the following commands?

docker ps -a

Maybe your PyCharm setup is running a fresh container every time?

iamkucuk commented 5 years ago

docker image does not persist your changes unless you tag it. However, you don't have to start your docker instance from an image every time. docker run will run a container from an image. Hover, once you have a running container, it will persist whatever changes you make until you remove it. what do you see when you run the following commands?

docker ps -a

Maybe your PyCharm setup is running a fresh container every time?

Yeah it is true. PyCharm is running up a fresh container every time.

Well, I kinda solved the situation in a temporary way. I set up a container from original pytorch-rocm image, pip installed the needed packages, and created another image from that container. I did the same thing before, it diddn't work. Oddly, now it seems like working for now.

Any experience on PyCharm? Is there a way to run pycharm on same container instead of creating a new one everytime?

bernharl commented 3 years ago

Any updates on this?

xuhuisheng commented 3 years ago

AMD provide a nightly building version of pytorch. Anybody who interesting in it, could have a try. https://github.com/ROCmSoftwarePlatform/pytorch/issues/716#issuecomment-755866685

bernharl commented 3 years ago

AMD provide a nightly building version of pytorch. Anybody who interesting in it, could have a try. #716 (comment)

Ah, great stuff. Thank you!