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

Download speed issues with the pytorch conda channel #17023

Open
WERAQS opened this issue Feb 12, 2019 · 92 comments
Open

Download speed issues with the pytorch conda channel #17023

WERAQS opened this issue Feb 12, 2019 · 92 comments
Labels
module: dependency bug Problem is not caused by us, but caused by an upstream library we use triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@WERAQS
Copy link

WERAQS commented Feb 12, 2019

Download speed of pytorch/torch is too slow. I'm downloading the file around 80KB/s at 24MBit/s connection. I've searched the same file I've been downloading and found at a mirror which lets 1MB/s download speed, what is going on with pytorch? not enough bandwidth for science?

original link for pip install torchvision was "https://files.pythonhosted.org/packages/93/b3/672813e65ac7605bac14a2a8e40e1a18e03bf0ac588c6a799508ee66c289/torch-1.0.1.post2-cp27-cp27mu-manylinux1_x86_64.whl"

the link I'm downloading it now; https://pypi.lcsb.uni.lu/packages/93/b3/672813e65ac7605bac14a2a8e40e1a18e03bf0ac588c6a799508ee66c289/torch-1.0.1.post2-cp27-cp27mu-manylinux1_x86_64.whl

this is seriously weird.

@ezyang
Copy link
Contributor

ezyang commented Feb 12, 2019

What country are you downloading from?

@WERAQS
Copy link
Author

WERAQS commented Feb 12, 2019

Turkey, no vpn, no dns setting on the modem or at ubuntu. Other pip packages can be downloaded at speeds of ~400KB/s to ~2MB/s with no problem

@ezyang
Copy link
Contributor

ezyang commented Feb 12, 2019

So, there's not much we can do if pythonhosted.org is very slow.

@soumith, do we upload the pip binaries also to download.pytorch.org? Might be helpful to also offer them as downloads from https://pytorch.org/get-started/previous-versions/

@WERAQS
Copy link
Author

WERAQS commented Feb 13, 2019

Just tested, your server works fine.

if you can change pip install to direct package name on your server it'd be better I think

@soumith
Copy link
Member

soumith commented Feb 14, 2019

We do also upload the binaries to our CloudFront / S3 powered buckets.

@WERAQS From the version selector on https://pytorch.org if you select CUDA10 + Linux + Pip, you will get direct links from this cloudfront / s3 bucket, and it should be much faster.
As of the pythonhosted.org's speed, yes we cant do much.

@soumith soumith closed this as completed Feb 14, 2019
@ctivanovich
Copy link

I would like to re-open this. I am downloading in Japan using the recommended package manager (conda), trying to get the 1.4.0 update because of the PIL import error for newer PIL, but the download speed is absurdly slow, it times out because it's so slow. pip is marginally faster, in that it doesn't time out, but still barely ~60 kb/s on a fast connection.

@agiUnderground
Copy link

torch .whl download speed is about 100 kilobytes/s, with my 100 Megabit internet connection, and this happening for a few days already. Country - Belarus. Is it related to the CDN problems? @ezyang please help.

@john-khgoh
Copy link

I'm facing the same issue downloading from Malaysia. It takes 4 hours+ to download 700MB which is quite ridiculous.

@schoonhovenrichard
Copy link

Also letting everyone know that download takes absurdly long in the Netherlands. Tested my internetspeed and it was 750Mbit/s download speed.

@yongen9696
Copy link

I'm facing the same issue downloading from Malaysia. It takes 4 hours+ to download 700MB which is quite ridiculous.

Same here from Malaysia, just want to download pretrained ResNet. Monitored the speed downloading, not even 10kb.

@Suji04
Copy link

Suji04 commented Apr 14, 2020

I'm (from India) using this command :
conda install pytorch==0.4.1 -c pytorch
After 2 hrs it's only 62% finished!

@vietnvri
Copy link

I'm facing the same issue, using this command:
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

@EngErik
Copy link

EngErik commented May 15, 2020

Same error here from Brazil!

@mathieuchateau
Copy link

Same from France, using 2 different internet operators (ISP)

@Shihab-Shahriar
Copy link

Same issue from Bangladesh, Internet speed ok for other tasks (~4mb/s)

@HeroadZ
Copy link

HeroadZ commented Aug 7, 2020

same situation in japan

@paysnugtech
Copy link

same situation here in Nigeria I have to try it on different isp even I use AWS server still not working

@Brikky
Copy link

Brikky commented Aug 23, 2020

Installed using conda install pytorch torchvision cudatoolkit=10.2 -c pytorch from San Francisco, California and it's taking ages.

Over an hour and I'm about 60% through it.

Using equivalent pip command also has an eta for ~6 hours.

@mathusuthan
Copy link

Same here in India ... Please resolve this issue ... this has been a recurring one for every release.

@shawngao94
Copy link

It's really weird. When I used the university network (HK) to download, it was very slow. The speed of other downloading tasks is fast. When I tried to use my phone to download the package from https://anaconda.org/pytorch/pytorch/files using my mobile data, the speed was pretty good... What's wrong with that?

@supersonic71
Copy link

Same from India, takes ages!

@supersonic71
Copy link

Much better with pip

@dseddah
Copy link

dseddah commented Sep 30, 2020

Same here from a Renater network where my speedtest gives me 840MB/S.
Downloading 25% of the 537MB of pytorch took more than 20mn.

@myavartanoo
Copy link

Same issue in Korea!

@SM-Fahim
Copy link

SM-Fahim commented Nov 3, 2020

I'm having the same issue.
I'm from Earth.
pip install torch torchvision

@krishnatejakanchi
Copy link

Why this issue is closed ? I am from India and it is taking hours to download.

@LemuelKL
Copy link

Same from Hong Kong.

@DumbMachine
Copy link

installing using an older version, which is not hosted on pythonhosted.org

pip install torch==1.7.0+cu101 torchvision==0.8.1+cu101 torchaudio==0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

@ghoore
Copy link

ghoore commented Dec 7, 2021

  • Operating System: Windows 10
  • Environment: Anaconda3

I do conda install pytorch torchvision cudatoolkit -c pytorch without any VPN.
Result: Same issue. My connection is 20 (Mb/s) but PyTorch is taking ages to download.
Country: Iran

Is there a solution?
Can anybody help?

@KeygenLLC
Copy link

I'm getting normal speeds again. Maybe there was a bad hop server between me and wherever pytorch is being stored.

@atl333
Copy link

atl333 commented Jan 6, 2022

pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html

ETA: 1 day, 30kb/s
Internet speed test says i have 100Gb/s

killed it three times and suddenly it worked

@utkusaglm
Copy link

It's really weird. When I used the university network (HK) to download, it was very slow. The speed of other downloading tasks is fast. When I tried to use my phone to download the package from https://anaconda.org/pytorch/pytorch/files using my mobile data, the speed was pretty good... What's wrong with that?

I also tried phone and it solved my issue

@mikevitz
Copy link

mikevitz commented Feb 6, 2022

I am in USA (Virginia). Having the same problem connecting using an AWS instance. Has high bandwidth availability and initial speeds are good. Then it throttles down to 1kb/s and ETA for download is days away.

How can this be resolved?

P.S. I tried
pip install -f https://download.pytorch.org/whl/torch_stable.html torch

This also failed with throttling

@dbish
Copy link

dbish commented Feb 10, 2022

I am in USA (Virginia). Having the same problem connecting using an AWS instance. Has high bandwidth availability and initial speeds are good. Then it throttles down to 1kb/s and ETA for download is days away.

How can this be resolved?

P.S. I tried pip install -f https://download.pytorch.org/whl/torch_stable.html torch

This also failed with throttling

This doesn't solve your problem directly, but if you are already using AWS with EC2, you could spin up an instance with the Deep Learning AMI and have it ready to go with PyTorch in just a couple minutes if you are ok starting with a new instance. See more info here: https://docs.aws.amazon.com/dlami/latest/devguide/tutorial-pytorch.html

@kuncung38
Copy link

When i used conda install command, provided by . I also got a very slow speed, half a day, still 50%.

So i tried to look up the file on google, first result is from .
I downloaded the same file that was shown from my command prompt / terminal.
The result is 10kbps.

Then, i tried to use pip install command, the result is 1.5Mbps.

Summary?
I think something is wrong with the server provided by conda.

@XinBow99
Copy link

pip install torch torchvision -f https://download.pytorch.org/whl/torch_stable.html work well

@ledhieu
Copy link

ledhieu commented Apr 11, 2022

adding --no-cache-dir works for me
mine was: pip install torch torchvision -f https://download.pytorch.org/whl/torch_stable.html --no-cache-dir

@zl190
Copy link

zl190 commented Apr 18, 2022

pip3 install torch torchvision --no-cache-dir works for me

@nitishsaDire
Copy link

I tried downloading PyTorch from conda and it was taking a lot of time with a speed of less than 100kbps.
Then I canceled it midway and again tried to download, but the speed was increased to 1mbps.

@cprakashagr
Copy link

I upgraded my pip: pip3 install --upgrade pip and the py torch installation was very fast post that.

@rgommers
Copy link
Collaborator

It is possible that the pytorch channel is misconfigured somehow, or that it's extra slow because it has exceeded the soft limits on cumulative size of packages in the channel. Or, all conda channels are slow. It'd be good to figure out which one it is for folks here, because if something is specific to the pytorch channel only, it may be easier to improve.

If some folks that can reproduce this can report the report of installing pytorch from the pytorch channel together with some other packages (e.g., python, cudatoolkit or numpy) from the defaults or conda-forge channel, that would be super useful.

Also, please use mamba, it reports all download speeds and package sizes. Example for conda-forge + pytorch channels:

# metadata
conda-forge/noarch                                   8.7MB @ 374.1kB/s 23.4s

# package downloads
numpy                                                6.2MB @  34.8kB/s 47.8s
python                                              12.9MB @  52.7kB/s 1m:36.6s
pytorch                                             42.6MB @  32.2kB/s 22m:2.9s

So I see no difference between conda-forge and pytorch here in Croatia (it's just slow all around). And I never noticed this issue in the Netherlands, downloads there are usually quite fast.

@jph00
Copy link

jph00 commented Jul 10, 2022

I can confirm I saw that two days ago when installing with latest mambaforge on latest ubuntu. I can't easily show you the log since I had to cancel it since it was taking too long. Doing mamba install -c pytorch pytorch in a fresh env took ~6 minutes for every package to download, except for pytorch, which was still at ~4%, and was downloading at 32kB/s. It estimated it would take 12 hours to complete. Large packages like MKL and cudatoolkit were shown at around 4MB/s by mamba.

I cancelled and restarted a couple of times but it didn't improve.

I then switched to a US VPN and restarted and it jumped to 6MB/s.

This has been what I've observed about 80% of the time in Australia, in Melbourne Vic and Brisbane Qld. I've tried on Mac, Linux, and Windows (both native and WSL).

@rgommers
Copy link
Collaborator

It's also possible that it's a cloud service cache eviction issue in some cases. The pytorch package files are currently 1.2 GB; such large files are not retained for long. I've observed a couple of times recently when measuring download speed that the channel metadata files are downloaded faster than other packages. Which makes sense, because everyone needs that metadata before each conda/mamba solve. It could also explain why a US VPN helps; switching to a region where pytorch is downloaded more frequently means it's probably still in cache.

Let's see what the conda infra folks say ....

@rgommers rgommers changed the title download speed Download speed issues with the pytorch conda channel Jul 12, 2022
@rgommers
Copy link
Collaborator

Some issues with Pip were mixed in, but most of this seems to be specific to the conda pytorch channel. So renamed to scope the issue to that topic.

@HOMINHQUYEN-1996-TLUS
Copy link

same error in singapore

@sandeepgadhwal
Copy link

sandeepgadhwal commented Aug 15, 2022

I think i have a solution for this, atleast works fine in my case.

I tried downloading the package directly from anaconda website using my browser it was fast. But on other hand conda was slow in downloading it.

I tried debugging this issue by looking into conda code. I found this method to be a time taking one
def add_binstar_token(url):

I found that we can disable this by setting this property add_anaconda_token. Use this command to set it conda config --set add_anaconda_token False.

Now i am getting comparable speed on browser as well as via conda.

@prafulbagai
Copy link

i do "pip install --no-cache-dir torch" in sames cases is not the download speed is the ram memory very low.

This solved my issue.

@rohit7044
Copy link

Don't ask me why
But change your internet from wifi to your phone.
Stuck on this for 6 hours, and suddenly after changing the network, BOOM!!
Works like Butter

@WitzerLW
Copy link

WitzerLW commented Apr 1, 2023

same thing here in China.
I'm downloading the latest version of pytorch via Anaconda on my laptop, it took 1 hour to just download 2% of the files
tried this:
#17023 (comment)
it actually worked. just imput the command before downloading, then it'll work just fine.
thanks for sharing your solution @sandeepgadhwal hope that more people will know about it

@AntonOfTheWoods
Copy link

What a nightmare. Hours and hours. Aren't we supposed to be in 2023, with everything being rebuilt from scratch every time we change anything?

@Zevil1991
Copy link

Everyone having this issue, listen.

It's not because the download speed is slow or an issue with the server. The issue is the RAM throttling on your CMD prompt. If you want to install PyTorch, just include the command --no-cache-dir in your install. For example, I used this command (pip3 install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118) and my download speed went from barely 100KB/s to 2.5MB/s and my 2.6 GB download is almost done after only a few minutes.

@maskedhypocrite
Copy link

Hey, I am having the same issue. I am new to all this so please bear with me.

If I try to install using conda, it just stays stuck on the solving environment screen. But, if I use pip, it just works perfectly and downloads pytorch super quickly. I want to use pip to install Pytorch but I need to use conda for the later steps in installing pytorch.

I am worried that using pip to install pytorch will lead to issues when I use conda to install pytorch3d

Should I just proceed to install pytorch with pip, will it lead to any issues if i use conda later?

@sandeepgadhwal
Copy link

sandeepgadhwal commented Jun 12, 2023

@maskedhypocrite When you try to install in conda, are you creating a new environment or you are trying to install it in an existing environment ?

@rgommers
Copy link
Collaborator

If I try to install using conda, it just stays stuck on the solving environment screen.

@maskedhypocrite if that happens, use mamba instead of conda - it's typically >10x faster when solving, and solves things that conda gets completely stuck on.

That should work; if not there is something wrong with your environment and you're better off creating a new environment.

@mugendi
Copy link

mugendi commented Nov 18, 2023

Guys, I have had this problem with pytorch as well as tensorflow. My solution fopr these huge packages these days is devpi (https://github.com/devpi/devpi).

First ensure you have updated pip. Then install via devpi-server (read more HERE) after that first successful install, devpi should create a local mirror. This works well especially if you have locked your package versions so that the local mirror always serves the local version.

Try it.

That said, other than updating pip and using the fastest internet connection, I have no other tricks up my sleeve for the first install. This works its magic in consequent installs.

@Krullet
Copy link

Krullet commented Dec 13, 2023

--no-cache-dir

This did it! From 7.3KB/s to 16.4 MB/s 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: dependency bug Problem is not caused by us, but caused by an upstream library we use triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests