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

Use index-url for all test steps #4948

Merged
merged 4 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test-export-matrix-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
installation:
- pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
- pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
with:
binary-matrix: ${{ toJSON(matrix) }}
script: |
Expand All @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
installation:
- pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
- pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
with:
binary-matrix: ${{ toJSON(matrix) }}
script: |
Expand All @@ -35,7 +35,7 @@ jobs:
fail-fast: false
matrix:
installation:
- pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
- pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
with:
binary-matrix: ${{ toJSON(matrix) }}
script: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test_linux_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
script: |
conda create --yes --quiet -n test python=3.8
conda activate test
python3 -m pip install --extra-index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
# Can import pytorch
python3 -c 'import torch'
test-gpu:
Expand All @@ -57,24 +57,24 @@ jobs:
matrix:
runner_type: ["linux.4xlarge.nvidia.gpu", "linux.g5.4xlarge.nvidia.gpu"]
with:
job-name: "linux-py3.8-cu116"
job-name: "linux-py3.8-cu121"
runner: ${{ matrix.runner_type }}
test-infra-repository: ${{ github.repository }}
test-infra-ref: ${{ github.ref }}
submodules: ${{ 'true' }}
gpu-arch-type: cuda
gpu-arch-version: "11.6"
gpu-arch-version: "12.1"
timeout: 60
script: |
conda create --yes --quiet -n test python=3.8
conda activate test
python3 -m pip install --extra-index-url https://download.pytorch.org/whl/nightly/cu116 --pre torch
python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cu121 --pre torch
# Can import pytorch, cuda is available
python3 -c 'import torch;cuda_avail = torch.cuda.is_available();print("CUDA available: " + str(cuda_avail));assert(cuda_avail)'
python3 -c 'import torch;t = torch.ones([2,2], device="cuda:0");print(t);print("tensor device:" + str(t.device))'
nvidia-smi
nvcc --version | grep "cuda_11.6"
[[ "${CUDA_HOME}" == "/usr/local/cuda-11.6" ]] || exit 1
nvcc --version | grep "cuda_12.1"
[[ "${CUDA_HOME}" == "/usr/local/cuda-12.1" ]] || exit 1
test-docker-image:
uses: ./.github/workflows/linux_job.yml
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test_macos_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
script: |
conda create --yes --quiet -n test python=3.8
conda activate test
python3 -m pip install --extra-index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
# Can import pytorch
python3 -c 'import torch'
test-m1:
Expand All @@ -34,7 +34,7 @@ jobs:
script: |
conda create --yes --quiet -n test python=3.8
conda activate test
python3 -m pip install --extra-index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
# Can import pytorch, cuda is available
python3 -c 'import torch'
test-x86-with-repo:
Expand All @@ -49,7 +49,7 @@ jobs:
script: |
conda create --yes --quiet -n test python=3.8
conda activate test
python3 -m pip install --extra-index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
# Can import pytorch
python3 -c 'import torch'
test-m1-with-repo:
Expand All @@ -66,7 +66,7 @@ jobs:
script: |
conda create --yes --quiet -n test python=3.8
conda activate test
python3 -m pip install --extra-index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
# Can import pytorch, cuda is available
python3 -c 'import torch'
test-upload-artifact:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_windows_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
script: |
conda create --yes --quiet -n test python=3.8
conda activate test
python -m pip install --extra-index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
python -m pip install --index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
# Can import pytorch
python -c 'import torch'
test-gpu:
Expand Down
2 changes: 1 addition & 1 deletion tools/pkg-helpers/pytorch_pkg_helpers/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_pytorch_pip_install_command(
if channel == "nightly":
pip_install += " --pre"
extra_index = f"https://download.pytorch.org/whl/{channel}/{gpu_arch_version}"
return [f"export PIP_INSTALL_TORCH='{pip_install} --extra-index-url {extra_index}'"]
return [f"export PIP_INSTALL_TORCH='{pip_install} --index-url {extra_index}'"]


def get_pytorch_s3_bucket_path(
Expand Down
3 changes: 1 addition & 2 deletions tools/scripts/generate_binary_build_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ def get_wheel_install_command(
use_only_dl_pytorch_org: bool,
) -> str:

index_url_option = "--index-url" if os != LINUX_AARCH64 else "--extra-index-url"
if channel == RELEASE and (not use_only_dl_pytorch_org) and (
(gpu_arch_version == "12.1" and os == LINUX)
or (
Expand All @@ -289,7 +288,7 @@ def get_wheel_install_command(
if channel == "nightly"
else f"{WHL_INSTALL_BASE} {PACKAGES_TO_INSTALL_WHL}"
)
return f"{whl_install_command} {index_url_option} {get_base_download_url_for_repo('whl', channel, gpu_arch_type, desired_cuda)}"
return f"{whl_install_command} --index-url {get_base_download_url_for_repo('whl', channel, gpu_arch_type, desired_cuda)}"


def generate_conda_matrix(
Expand Down
Loading