Skip to content

Commit

Permalink
Update pep503_whl_redirect to accomodate for rocm maj.min.patch versi…
Browse files Browse the repository at this point in the history
…on (#6071)

I am seeing validation error here:

https://github.com/pytorch/test-infra/actions/runs/12357596722/job/34504501590#step:14:2563
Executing:
```pip3 install --force-reinstall torch --index-url https://download.pytorch.org/whl/test/rocm6.2.4```
does not work, accessing https://download.pytorch.org/whl/test/6.2.4 does not work either
  • Loading branch information
atalman authored Dec 17, 2024
1 parent 1909bf4 commit 4cf1ffb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aws/websites/download.pytorch.org/pep503_whl_redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ function handler(event) {
var uri = request.uri;
var uri_parts = uri.split('/')
var last_uri_part = uri_parts[uri_parts.length -1]
var rocm_pattern = /^rocm[0-9]+\.[0-9]+$/
var rocm_pattern = /^rocm[0-9]+(\.[0-9]+)*$/

if (uri.startsWith('/whl')) {
// Check whether the URI is missing a file name.
if (uri.endsWith('/')) {
request.uri += 'index.html';
// Check whether the URI is folder like
// I.e. does not have dots in path or rocm\d.\d or 1.8 (for lts)
// I.e. does not have dots in path or rocm\d.\d or rocm\d.\d.\d or 1.8 (for lts)
// For example /whl/cpu/torch
} else if (last_uri_part.indexOf('.') == -1
|| last_uri_part.match(rocm_pattern)
Expand Down

0 comments on commit 4cf1ffb

Please sign in to comment.