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 CUDA version ranges in release selector. #524

Merged
merged 17 commits into from
Jul 24, 2024
57 changes: 38 additions & 19 deletions _includes/selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@
</div>
</template>
</div>
<div class="options-section" x-show="active_method !== 'pip'">
<div class="options-section" x-show="active_method === 'Conda'">
<div class="option-label">ENV. CUDA</div>
<template x-for="version in cuda_vers">
<div x-on:click="(e) => cudaClickHandler(e, version)"
x-bind:class="{'active': version === active_cuda_ver, 'disabled': disableUnsupportedCuda(version)}"
<template x-for="version in conda_cuda_vers">
<div x-on:click="(e) => condaCUDAClickHandler(e, version)"
x-bind:class="{'active': version === active_conda_cuda_ver, 'disabled': disableUnsupportedCuda(version)}"
class="option" x-text="'CUDA ' + version"></div>
</template>
</div>
Expand All @@ -260,6 +260,14 @@
x-text="'CUDA ' + version"></div>
</template>
</div>
<div class="options-section" x-show="active_method === 'Docker'">
<div class="option-label">Image CUDA</div>
<template x-for="version in docker_cuda_vers">
<div x-on:click="(e) => dockerCUDAClickHandler(e, version)"
x-bind:class="{'active': version === active_docker_cuda_ver, 'disabled': disableUnsupportedCuda(version)}"
class="option" x-text="'CUDA ' + version"></div>
</template>
</div>
<div class="options-section" x-show="active_method !== 'pip'">
<div class="option-label">Python</div>
<template x-for="version in python_vers">
Expand Down Expand Up @@ -360,8 +368,9 @@
Alpine.data('rapids_selector', () => ({
// default values
active_python_ver: "3.11",
active_cuda_ver: "12.2",
active_conda_cuda_ver: "12.0 - 12.2",
active_pip_cuda_ver: "12",
active_docker_cuda_ver: "12.2",
active_method: "Conda",
active_release: "Stable",
active_img_type: "Base",
Expand All @@ -371,8 +380,9 @@

// all possible values
python_vers: ["3.9", "3.10", "3.11"],
cuda_vers: ["11.2", "11.8", "12.0", "12.2", "12.5"],
pip_cuda_vers: ["11.2 - 11.8", "12"],
conda_cuda_vers: ["11.4 - 11.8", "12.0 - 12.2", "12.0 - 12.5"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
conda_cuda_vers: ["11.4 - 11.8", "12.0 - 12.2", "12.0 - 12.5"],
conda_cuda_vers: ["11.4 - 11.8", "12.0 - 12.2", "12.0 - 12.5"],
conda_cuda_ver_nightly: "12.0 - 12.5",
// TODO: Change to "12.0 - 12.5" once RAPIDS 24.08 releases
conda_cuda_ver_stable: "12.0 - 12.2",

pip_cuda_vers: ["11.4 - 11.8", "12"],
docker_cuda_vers: ["11.8", "12.0", "12.2", "12.5"],
methods: ["Conda", "pip", "Docker"],
releases: ["Stable", "Nightly"],
img_loc: ["NGC", "Dockerhub"],
Expand Down Expand Up @@ -437,8 +447,9 @@
var rapids_channel = this.active_release === "Stable" ? "rapidsai" : "rapidsai-nightly";
var dask_prefix = this.active_release === "Nightly" ? "dask/label/dev::" : "";
var python_version = this.active_python_ver;
var cuda_version = this.active_cuda_ver;
var py_cuda_pkgs = [this.highlightPkgOrImg("python") + "=" + python_version, this.highlightPkgOrImg("cuda-version") + "=" + cuda_version].join(" ");
var cuda_version_bounds = this.active_conda_cuda_ver.split(" - ");
var cuda_version_pinning = ">=" + cuda_version_bounds[0] + ".*,<=" + cuda_version_bounds[1] + ".*";
var py_cuda_pkgs = [this.highlightPkgOrImg("python") + "=" + python_version, this.highlightPkgOrImg("cuda-version") + cuda_version_pinning].join(" ");
var conda_channels = [rapids_channel, "conda-forge", "nvidia"]
.map(ch => "-" + this.highlightFlag("c") + " " + ch + " ")
.join("");
Expand Down Expand Up @@ -583,7 +594,7 @@

var imgTag = [
(isNightly ? this.getNightlyVersion() + "a" : this.getStableVersion()),
"cuda" + this.active_cuda_ver,
"cuda" + this.active_docker_cuda_ver,
"py" + this.active_python_ver
].join("-");

Expand All @@ -603,7 +614,7 @@
},
getDockerNotes() {
var notes = [];
if (this.active_cuda_ver.startsWith("12") && this.active_release === "Stable") {
if (this.active_docker_cuda_ver.startsWith("12") && this.active_release === "Stable") {
var pkgs_html = this.rapids_meta_pkgs.map(pkg => "<code>" + pkg + "</code>").join(", ");
notes = [...notes]
} else {
Expand Down Expand Up @@ -673,9 +684,9 @@
},
disableUnsupportedCuda(cuda_version) {
var isDisabled = false;
if (this.active_additional_packages.includes("TensorFlow") && (cuda_version !== "12.0")) isDisabled = true;
if (this.active_method === "Docker" && cuda_version < "11.8") isDisabled = true;
if (this.active_release === "Stable" && cuda_version === "12.5") isDisabled = true;
if (this.active_additional_packages.includes("TensorFlow") && (!cuda_version.startsWith("12"))) isDisabled = true;
// Remove once stable releases support CUDA 12.5
if (this.active_release === "Stable" && cuda_version.includes("12.5")) isDisabled = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Remove once stable releases support CUDA 12.5
if (this.active_release === "Stable" && cuda_version.includes("12.5")) isDisabled = true;
if (this.active_release === "Stable" && cuda_version == conda_cuda_ver_nightly) isDisabled = (conda_cuda_ver_stable != conda_cuda_ver_nightly);

return isDisabled;
},
disableUnsupportedPython(python_version) {
Expand Down Expand Up @@ -705,22 +716,30 @@
releaseClickHandler(e, release) {
if (this.isDisabled(e.target)) return;
this.active_release = release;
if ( this.active_release === "Stable" && this.active_cuda_ver === "12.5") {
this.active_cuda_ver = "12.2";
// Remove once stable releases support CUDA 12.5
if (this.active_release === "Stable" && this.active_conda_cuda_ver === "12.0 - 12.5") {
this.active_conda_cuda_ver = "12.0 - 12.2";
}
if (this.active_release === "Stable" && this.active_docker_cuda_ver === "12.5") {
this.active_docker_cuda_ver = "12.2";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Remove once stable releases support CUDA 12.5
if (this.active_release === "Stable" && this.active_conda_cuda_ver === "12.0 - 12.5") {
this.active_conda_cuda_ver = "12.0 - 12.2";
}
if (this.active_release === "Stable" && this.active_docker_cuda_ver === "12.5") {
this.active_docker_cuda_ver = "12.2";
if (this.active_release === "Stable" && this.active_conda_cuda_ver === this.conda_cuda_ver_nightly) {
this.active_conda_cuda_ver = this.conda_cuda_ver_nightly;
}
if (this.active_release === "Stable" && this.active_docker_cuda_ver === "12.5") {
this.active_docker_cuda_ver = "12.2";

}
Comment on lines +736 to 738
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about capturing 12.5 & 12.2 in variables in the "all possible values" section?

Perhaps we could do something like...?

Suggested change
if (this.active_release === "Stable" && this.active_docker_cuda_ver === "12.5") {
this.active_docker_cuda_ver = "12.2";
}
if (this.active_release === "Stable" && this.active_docker_cuda_ver === this.nightly_docker_cuda_ver) {
this.active_docker_cuda_ver = this.stable_docker_cuda_ver;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we leave this for a later PR? I think this ties in with the above thread, where I struggled to get a "structured" JSON format to work.

},
imgTypeClickHandler(e, type) {
if (this.isDisabled(e.target)) return;
this.active_img_type = type;
},
cudaClickHandler(e, version) {
condaCUDAClickHandler(e, version) {
if (this.isDisabled(e.target)) return;
this.active_cuda_ver = version;
this.active_conda_cuda_ver = version;
},
pipCUDAClickHandler(e, version) {
if (this.isDisabled(e.target)) return;
this.active_pip_cuda_ver = version;
},
dockerCUDAClickHandler(e, version) {
if (this.isDisabled(e.target)) return;
this.active_docker_cuda_ver = version;
},
pythonClickHandler(e, version) {
if (this.isDisabled(e.target)) return;
this.active_python_ver = version;
Expand Down Expand Up @@ -789,7 +808,7 @@
return;
}
this.active_additional_packages = [...this.active_additional_packages, package];
if (this.active_additional_packages.includes("TensorFlow") && (this.active_cuda_ver !== "12.0")) this.active_cuda_ver = "12.0";
if (this.active_additional_packages.includes("TensorFlow") && (!this.active_conda_cuda_ver.includes("12.0"))) this.active_conda_cuda_ver = "12.0 - 12.2";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this.active_additional_packages.includes("TensorFlow") && (!this.active_conda_cuda_ver.includes("12.0"))) this.active_conda_cuda_ver = "12.0 - 12.2";
if (this.active_additional_packages.includes("TensorFlow") && (!this.active_conda_cuda_ver.includes("12.0"))) this.active_conda_cuda_ver = this.conda_cuda_ver_stable;

},
copyToClipboard() {
let range = document.createRange();
Expand Down