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

自从上次维护后,pip下载pytorch变得很慢 #368

Open
Touch-Night opened this issue Jun 25, 2024 · 7 comments
Open

自从上次维护后,pip下载pytorch变得很慢 #368

Touch-Night opened this issue Jun 25, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@Touch-Night
Copy link

此前下载可以跑满带宽,现在只有100~200kb/s

@Touch-Night Touch-Night added the bug Something isn't working label Jun 25, 2024
@PhotonQuantum
Copy link
Member

现在呢?我们的 pip 带有缓存机制,所以如果之前没有用户提前触发缓存的话会回源。缓存后速度就会恢复正常。

@Touch-Night
Copy link
Author

现在是200~300kb/s

@longisland-icetea
Copy link

目前看起来是重定向到pytorch官网了
Looking in indexes: https://mirror.sjtu.edu.cn/pytorch-wheels/cu121 Collecting torch==2.2.1 Downloading https://download.pytorch.org/whl/cu121/torch-2.2.1%2Bcu121-cp311-cp311-win_amd64.whl (2454.8 MB)

@ppwwyyxx
Copy link

是的,似乎所有/cuxxx/的都重定向到官网了

@Certseeds
Copy link

仍能复现

$ curl -L -I -X GET "https://mirror.sjtu.edu.cn/pytorch-wheels/cu121/"
HTTP/2 301 
alt-svc: h3=":443"; ma=2592000
location: https://download.pytorch.org/whl/cu121
server: Caddy
x-intel-queue-length: 0
x-sjtug-mirror-id: siyuan
content-length: 0

301过去之后得看日志才能看出下载慢的原因, 有点让人困惑.
更奇怪的是, 从https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html页面上看,

$ curl -L -I -X GET "https://mirror.sjtu.edu.cn/pytorch-wheels/cu121/torch-2.3.1%2Bcu121-cp312-cp312-win_amd64.whl"
HTTP/2 301 
alt-svc: h3=":443"; ma=2592000
location: https://s3.jcloud.sjtu.edu.cn/899a892efef34b1b944a19981040f55b-oss01/pytorch-wheels/cu121/torch-2.3.1%2Bcu121-cp312-cp312-win_amd64.whl
server: Caddy
x-intel-queue-length: 0
x-sjtug-mirror-id: siyuan
content-length: 0

HTTP/1.1 200 OK
Server: openresty/1.13.6.1
Content-Type: application/octet-stream
Content-Length: 2423460849
Connection: keep-alive
Accept-Ranges: bytes
Last-Modified: Tue, 04 Jun 2024 19:57:54 GMT
ETag: "1caf2e7b3fc368719748b2ba82ae74da"
x-amz-request-id: tx00000000000001ea97792-0066b733a9-71a0757-zone-00864d
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE, PUT, PATCH
Access-Control-Allow-Headers: content-type,x-amz-server-side-encryption,range,x-amz-user-agent,x-amz-copy-source,x-amz-content-sha256,x-amz-date,authorization,x-amz-acl,etag,content-encoding,x-requested-with

确实存着一份, 而且可以拉取.

@Certseeds
Copy link

不确定是否和 #288 有关.

@Certseeds
Copy link

在用poetry作为包管理时会因为上面的301逻辑, 导致https://mirror.sjtu.edu.cn/pytorch-wheels/cu121/torch/被转发到 https://download.pytorch.org/whl/cu121/torch, 进而后续请求都是download.pytorch.org了. 也不能简单改成

[[tool.poetry.source]]
name = "pytorch-gpu-src"
url = "https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html"
priority = "explicit"

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
None yet
Development

No branches or pull requests

5 participants