Revert "Split careless into CPU module and careless-gpu using cuda/12.8.1 module"
This reverts commit 20e69678da.
This commit is contained in:
1 parent
38ca2271f0
commit
5daa7cd94e
7 files changed
+13
-102
No files matched your search
+3
-8
@@ -11,14 +11,9 @@ inference (variational merging), built on TensorFlow.
|
||||
Upstream recommends a fresh conda env, but repo.anaconda.com is not
|
||||
reachable from Ra, so the build uses uv instead: it fetches a standalone
|
||||
Python 3.12 into `$PREFIX/python` (upstream supports >=3.9,<3.13), creates
|
||||
`$PREFIX/venv`, and runs `uv pip install careless==<version>` into it.
|
||||
This is the CPU build; the GPU build (with the `[cuda]` extra and the
|
||||
cluster `cuda/12.8.1` module) is the separate `careless-gpu` module.
|
||||
|
||||
To share one uv download cache between the careless and careless-gpu
|
||||
builds, run each with `UV_CACHE_DIR=<shared path> modbuild build <version>`
|
||||
— a cache outside PREFIX is kept, an in-PREFIX cache is removed after a
|
||||
successful install.
|
||||
`$PREFIX/venv`, and runs `uv pip install careless[cuda]==<version>` into
|
||||
it. The `[cuda]` extra pulls the NVIDIA libraries as pip wheels, so the
|
||||
same install works on GPU and CPU-only Ra nodes.
|
||||
|
||||
`uv` must be on PATH on the build host (e.g. `pip install --user uv`).
|
||||
|
||||
|
||||
+7
-9
@@ -8,11 +8,10 @@ pbuild::configure() {
|
||||
# repo.anaconda.com is unreachable from Ra (GnuTLS error), so no conda.
|
||||
# uv fetches a standalone CPython instead; keep it inside PREFIX so the
|
||||
# venv's interpreter symlinks don't depend on the builder's home cache.
|
||||
# modbuild's shell strips ~/.local/bin from PATH; override with UV=/path/to/uv if needed
|
||||
UV="${UV:-$HOME/.local/bin/uv}"
|
||||
# ~/.cache/uv hits the home disk quota; default the cache into PREFIX.
|
||||
# Overridable so careless and careless-gpu can share one cache:
|
||||
# UV_CACHE_DIR=<shared path> modbuild build <version>
|
||||
export UV_CACHE_DIR="${UV_CACHE_DIR:-$PREFIX/.uv-cache}"
|
||||
# ~/.cache/uv hits the home disk quota; cache under PREFIX (removed after install)
|
||||
export UV_CACHE_DIR="$PREFIX/.uv-cache"
|
||||
export UV_PYTHON_INSTALL_DIR="$PREFIX/python"
|
||||
"$UV" venv --python 3.12 "$PREFIX/venv"
|
||||
}
|
||||
@@ -23,9 +22,8 @@ pbuild::compile() {
|
||||
|
||||
pbuild::install() {
|
||||
UV="${UV:-$HOME/.local/bin/uv}"
|
||||
export UV_CACHE_DIR="${UV_CACHE_DIR:-$PREFIX/.uv-cache}"
|
||||
# CPU version; the GPU build with the [cuda] extra is the careless-gpu module
|
||||
"$UV" pip install --python "$PREFIX/venv/bin/python" "careless==${V_PKG}"
|
||||
# only auto-remove the cache if it lives inside this PREFIX (never a shared one)
|
||||
[[ "$UV_CACHE_DIR" == "$PREFIX"* ]] && rm -rf "$UV_CACHE_DIR" || :
|
||||
export UV_CACHE_DIR="$PREFIX/.uv-cache"
|
||||
# [cuda] extra ships the NVIDIA libs via pip wheels; works on CPU-only nodes too
|
||||
"$UV" pip install --python "$PREFIX/venv/bin/python" "careless[cuda]==${V_PKG}"
|
||||
rm -rf "$UV_CACHE_DIR"
|
||||
}
|
||||
+3
-2
@@ -7,8 +7,9 @@ module-maintainer "MX Data <jiaxin.duan@psi.ch>"
|
||||
|
||||
module-help "
|
||||
careless: scaling and merging of X-ray diffraction data using
|
||||
approximate Bayesian inference (TensorFlow). CPU build; for
|
||||
NVIDIA GPU nodes load careless-gpu instead.
|
||||
approximate Bayesian inference (TensorFlow). Installed with the
|
||||
[cuda] extra, so it uses NVIDIA GPUs when available and falls
|
||||
back to CPU otherwise.
|
||||
"
|
||||
|
||||
setenv CARELESS_ENV $PREFIX/venv
|
||||
|
||||
Reference in new issue
Block a user