chore: Migrate Pixi system-requirements to custom platforms#43
chore: Migrate Pixi system-requirements to custom platforms#43matthewfeickert wants to merge 14 commits into
Conversation
f759683 to
c7e5f61
Compare
| > pixi task add --description "Train a PyTorch CNN classifier on the MNIST dataset" train "python ./main.py --epochs 20 --save-model" | ||
| > pixi workspace platform add --cuda 12.9 linux-64-cuda=linux-64 | ||
| > pixi add --platform linux-64-cuda pytorch-gpu torchvision 'cuda-version 12.9.*' --no-install | ||
| > pixi task add --platform linux-64-cuda --description "Train a PyTorch CNN classifier on the MNIST dataset" train "python ./main.py --epochs 20 --save-model" |
There was a problem hiding this comment.
Note though that the semantics are now that one would need to run
pixi run --platform linux-64-cuda train
to have the task be found. pixi task add has --default-environment but it doesn't have --default-platform.
I'm not sure if this would be reasonable to request or not.
|
For Line 65 in c954ba6 the templates-GPUs/pixi/mnist_gpu.sh Line 21 in c954ba6 which shows that a Pixi is now resolving virtual packages from the machine doing the resolution (my laptop) $ head -n 15 ./pixi.lock
version: 7
platforms:
- name: p1
subdir: linux-64
virtual-packages:
- __cuda=12.9
- __unix=0=0
- __linux=4.18
- __glibc=2.28
- __archspec=0=x86_64
environments:
default:
channels:
- url: https://conda.anaconda.org/conda-forge/
packages:
...it might be necessary to make these virtual packages be more broad. |
seems to be due to it landing on CHTC jobs, from templates-GPUs/pixi/mnist_gpu.sub Lines 19 to 41 in c954ba6 with when the environment is resolved to I think this either needs to have the submission areas tightened up to have more modern setups on CHTC or this should loosen the CUDA requirement to |
e9f5ed4 to
9f90d0f
Compare
* In Pixi v0.71.0 the system-requirements table was deprecated for custom platforms in the main workspace table. Add a 'linux-64-cuda' platform to support features with CUDA. - c.f. https://pixi.prefix.dev/v0.71.3/workspace/system_requirements/ * Update requires-pixi to 0.71.0 to ensure rich platform support. * Note in the docs that users now need to remove platforms that do not support the custom platform's virtual packages, or that the custom platform needs to be explicitly given in the 'pixi add' command.
HTCondor's container universe runs Docker images as the execute node's
slot uid, which has no /etc/passwd entry inside the container, and with
a scrubbed environment (no USER or LOGNAME set). Python's
getpass.getuser() then raises "OSError: No username set in the
environment", aborting 'import torchvision' when torch._inductor
resolves its cache directory (/tmp/torchinductor_<username>) at import
time.
Export fallback USER and LOGNAME (the numeric uid) in the generated
entrypoint.sh so getpass.getuser() resolves from the environment without
needing the passwd database, and fall back to a writable temporary
directory when HOME is unset or unwritable (Docker sets HOME=/ for
unknown uids), protecting workloads that write to ~/.cache (torch hub,
matplotlib, fontconfig).
Apptainer images are unaffected: Apptainer injects the invoking user's
passwd entry into the container at startup ('config passwd = yes'
default in apptainer.conf), so apptainer.def needs no change.
f2bf916 to
f6a102c
Compare
f6a102c to
ab4f184
Compare
Uh oh!
There was an error while loading. Please reload this page.