sjtug / mirror-requests

新镜像请求 & BUG 汇报
https://mirrors.sjtug.sjtu.edu.cn
49 stars 2 forks source link

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

Open Touch-Night opened 4 months ago

Touch-Night commented 4 months ago

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

PhotonQuantum commented 4 months ago

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

Touch-Night commented 4 months ago

现在是200~300kb/s

longisland-icetea commented 3 months ago

目前看起来是重定向到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 commented 3 months ago

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

Certseeds commented 3 months ago

仍能复现

$ 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 commented 3 months ago

不确定是否和 #288 有关.

Certseeds commented 3 months ago

在用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"