past_ci_versions.py 4.88 KB
Newer Older
Yih-Dar's avatar
Yih-Dar committed
1
2
3
4
5
6
import argparse
import os


past_versions_testing = {
    "pytorch": {
7
8
9
10
11
12
13
14
15
16
17
18
        "1.13": {
            "torch": "1.13.1",
            "torchvision": "0.14.1",
            "torchaudio": "0.13.1",
            "python": 3.9,
            "cuda": "cu116",
            "install": (
                "python3 -m pip install --no-cache-dir -U torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1"
                " --extra-index-url https://download.pytorch.org/whl/cu116"
            ),
            "base_image": "nvidia/cuda:11.6.2-cudnn8-devel-ubuntu20.04",
        },
Yih-Dar's avatar
Yih-Dar committed
19
20
21
22
23
24
25
26
27
28
        "1.12": {
            "torch": "1.12.1",
            "torchvision": "0.13.1",
            "torchaudio": "0.12.1",
            "python": 3.9,
            "cuda": "cu113",
            "install": (
                "python3 -m pip install --no-cache-dir -U torch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1"
                " --extra-index-url https://download.pytorch.org/whl/cu113"
            ),
29
            "base_image": "nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04",
Yih-Dar's avatar
Yih-Dar committed
30
        },
Yih-Dar's avatar
Yih-Dar committed
31
32
33
34
35
36
37
38
39
40
        "1.11": {
            "torch": "1.11.0",
            "torchvision": "0.12.0",
            "torchaudio": "0.11.0",
            "python": 3.9,
            "cuda": "cu113",
            "install": (
                "python3 -m pip install --no-cache-dir -U torch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0"
                " --extra-index-url https://download.pytorch.org/whl/cu113"
            ),
41
            "base_image": "nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04",
Yih-Dar's avatar
Yih-Dar committed
42
        },
Yih-Dar's avatar
Yih-Dar committed
43
44
45
46
47
48
49
50
51
52
        "1.10": {
            "torch": "1.10.2",
            "torchvision": "0.11.3",
            "torchaudio": "0.10.2",
            "python": 3.9,
            "cuda": "cu113",
            "install": (
                "python3 -m pip install --no-cache-dir -U torch==1.10.2 torchvision==0.11.3 torchaudio==0.10.2"
                " --extra-index-url https://download.pytorch.org/whl/cu113"
            ),
53
            "base_image": "nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04",
Yih-Dar's avatar
Yih-Dar committed
54
55
56
57
58
59
60
61
62
63
64
65
        },
        # torchaudio < 0.10 has no CUDA-enabled binary distributions
        "1.9": {
            "torch": "1.9.1",
            "torchvision": "0.10.1",
            "torchaudio": "0.9.1",
            "python": 3.9,
            "cuda": "cu111",
            "install": (
                "python3 -m pip install --no-cache-dir -U torch==1.9.1 torchvision==0.10.1 torchaudio==0.9.1"
                " --extra-index-url https://download.pytorch.org/whl/cu111"
            ),
66
            "base_image": "nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04",
Yih-Dar's avatar
Yih-Dar committed
67
        },
68
69
70
71
72
73
    },
    "tensorflow": {
        "2.11": {
            "tensorflow": "2.11.1",
            "install": "python3 -m pip install --no-cache-dir -U tensorflow==2.11.1",
            "base_image": "nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04",
Yih-Dar's avatar
Yih-Dar committed
74
        },
75
76
77
78
        "2.10": {
            "tensorflow": "2.10.1",
            "install": "python3 -m pip install --no-cache-dir -U tensorflow==2.10.1",
            "base_image": "nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04",
Yih-Dar's avatar
Yih-Dar committed
79
        },
80
81
82
83
        "2.9": {
            "tensorflow": "2.9.3",
            "install": "python3 -m pip install --no-cache-dir -U tensorflow==2.9.3",
            "base_image": "nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04",
Yih-Dar's avatar
Yih-Dar committed
84
85
86
87
        },
        "2.8": {
            "tensorflow": "2.8.2",
            "install": "python3 -m pip install --no-cache-dir -U tensorflow==2.8.2",
88
            "base_image": "nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04",
Yih-Dar's avatar
Yih-Dar committed
89
90
91
92
        },
        "2.7": {
            "tensorflow": "2.7.3",
            "install": "python3 -m pip install --no-cache-dir -U tensorflow==2.7.3",
93
            "base_image": "nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04",
Yih-Dar's avatar
Yih-Dar committed
94
95
96
97
        },
        "2.6": {
            "tensorflow": "2.6.5",
            "install": "python3 -m pip install --no-cache-dir -U tensorflow==2.6.5",
98
            "base_image": "nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04",
Yih-Dar's avatar
Yih-Dar committed
99
100
101
102
        },
        "2.5": {
            "tensorflow": "2.5.3",
            "install": "python3 -m pip install --no-cache-dir -U tensorflow==2.5.3",
103
            "base_image": "nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04",
Yih-Dar's avatar
Yih-Dar committed
104
105
106
107
108
109
110
        },
    },
}


if __name__ == "__main__":
    parser = argparse.ArgumentParser("Choose the framework and version to install")
111
112
113
114
    parser.add_argument(
        "--framework", help="The framework to install. Should be `torch` or `tensorflow`", type=str, required=True
    )
    parser.add_argument("--version", help="The version of the framework to install.", type=str, required=True)
Yih-Dar's avatar
Yih-Dar committed
115
116
117
118
119
120
121
122
123
124
125
126
    args = parser.parse_args()

    info = past_versions_testing[args.framework][args.version]

    os.system(f'echo "export INSTALL_CMD=\'{info["install"]}\'" >> ~/.profile')
    print(f'echo "export INSTALL_CMD=\'{info["install"]}\'" >> ~/.profile')

    cuda = ""
    if args.framework == "pytorch":
        cuda = info["cuda"]
    os.system(f"echo \"export CUDA='{cuda}'\" >> ~/.profile")
    print(f"echo \"export CUDA='{cuda}'\" >> ~/.profile")