Skip to content

WIP: python3Packages.torch: migrate to setupCudaHook#245516

Closed
SomeoneSerge wants to merge 3 commits intoNixOS:masterfrom
SomeoneSerge:torch-redist
Closed

WIP: python3Packages.torch: migrate to setupCudaHook#245516
SomeoneSerge wants to merge 3 commits intoNixOS:masterfrom
SomeoneSerge:torch-redist

Conversation

@SomeoneSerge
Copy link
Contributor

  • python3Packages.torch: asserts -> meta.broken
  • python3Packages.torch: symlinkJoin -> CUDAToolkit_ROOT
  • python3Packages.pynvml: drop the unused cudatoolkit input
Description of changes
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Jul 26, 2023
# confirm that cudatoolkits are sync'd across dependencies
assert !(MPISupport && cudaSupport) || mpi.cudatoolkit == cudatoolkit;
assert !cudaSupport || magma.cudaPackages.cudatoolkit == cudatoolkit;
with cudaPackages;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I probably shouldn't use with

Copy link
Member

Choose a reason for hiding this comment

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

At least not with that big of a scope.

@ofborg ofborg bot requested review from bcdarwin, teh, thoughtpolice and tscholak July 26, 2023 10:52
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jul 26, 2023
@SomeoneSerge
Copy link
Contributor Author

Result of nixpkgs-review pr 245516 --extra-nixpkgs-config '{ cudaCapabilities = [ "8.6" ]; cudaSupport = true; }' run on x86_64-linux 1

24 packages marked as broken and skipped:
  • python310Packages.dalle-mini
  • python310Packages.dalle-mini.dist
  • python310Packages.elegy
  • python310Packages.elegy.dist
  • python310Packages.pymanopt
  • python310Packages.pymanopt.dist
  • python310Packages.qiskit
  • python310Packages.qiskit-machine-learning
  • python310Packages.qiskit-machine-learning.dist
  • python310Packages.qiskit.dist
  • python310Packages.treex
  • python310Packages.treex.dist
  • python310Packages.vqgan-jax
  • python310Packages.vqgan-jax.dist
  • python311Packages.dalle-mini
  • python311Packages.dalle-mini.dist
  • python311Packages.elegy
  • python311Packages.elegy.dist
  • python311Packages.pymanopt
  • python311Packages.pymanopt.dist
  • python311Packages.treex
  • python311Packages.treex.dist
  • python311Packages.vqgan-jax
  • python311Packages.vqgan-jax.dist
174 packages failed to build:
  • easyocr (python310Packages.easyocr)
  • easyocr.dist (python310Packages.easyocr.dist)
  • khoj
  • khoj.dist
  • pentestgpt
  • pentestgpt.dist
  • piper-train (python310Packages.piper-train)
  • piper-train.dist (python310Packages.piper-train.dist)
  • python310Packages.arviz
  • python310Packages.arviz.dist
  • python310Packages.bambi
  • python310Packages.bambi.dist
  • python310Packages.boxx
  • python310Packages.boxx.dist
  • python310Packages.bpycv
  • python310Packages.bpycv.dist
  • python310Packages.clean-fid
  • python310Packages.clean-fid.dist
  • python310Packages.cleanlab
  • python310Packages.cleanlab.dist
  • python310Packages.clip
  • python310Packages.clip-anytorch
  • python310Packages.clip-anytorch.dist
  • python310Packages.clip.dist
  • python310Packages.detectron2
  • python310Packages.detectron2.dist
  • python310Packages.effdet
  • python310Packages.effdet.dist
  • python310Packages.fastai
  • python310Packages.fastai.dist
  • python310Packages.ffcv
  • python310Packages.ffcv.dist
  • python310Packages.grad-cam
  • python310Packages.grad-cam.dist
  • python310Packages.invisible-watermark
  • python310Packages.invisible-watermark.dist
  • python310Packages.k-diffusion
  • python310Packages.k-diffusion.dist
  • python310Packages.langchain
  • python310Packages.langchain.dist
  • python310Packages.manifest-ml
  • python310Packages.manifest-ml.dist
  • python310Packages.mmcv
  • python310Packages.mmcv.dist
  • python310Packages.pymc
  • python310Packages.pymc.dist
  • python310Packages.pytorch-lightning
  • python310Packages.pytorch-lightning.dist
  • python310Packages.pytorch-metric-learning
  • python310Packages.pytorch-metric-learning.dist
  • python310Packages.pytorch-pfn-extras
  • python310Packages.pytorch-pfn-extras.dist
  • python310Packages.sentence-transformers
  • python310Packages.sentence-transformers.dist
  • python310Packages.sfepy
  • python310Packages.sfepy.dist
  • python310Packages.skrl
  • python310Packages.skrl.dist
  • python310Packages.tensorboardx
  • python310Packages.tensorboardx.dist
  • python310Packages.timm
  • python310Packages.timm.dist
  • python310Packages.tiny-cuda-nn
  • python310Packages.torch-tb-profiler
  • python310Packages.torch-tb-profiler.dist
  • python310Packages.torchinfo
  • python310Packages.torchinfo.dist
  • python310Packages.torchvision
  • python310Packages.torchvision.dist
  • python310Packages.unstructured-inference
  • python310Packages.unstructured-inference.dist
  • python310Packages.xformers
  • python310Packages.xformers.dist
  • python310Packages.zcs
  • python310Packages.zcs.dist
  • python311Packages.apptools
  • python311Packages.apptools.dist
  • python311Packages.argos-translate-files
  • python311Packages.argos-translate-files.dist
  • python311Packages.argostranslate
  • python311Packages.argostranslate.dist
  • python311Packages.ax
  • python311Packages.ax.dist
  • python311Packages.botorch
  • python311Packages.botorch.dist
  • python311Packages.clean-fid
  • python311Packages.clean-fid.dist
  • python311Packages.cleanlab
  • python311Packages.cleanlab.dist
  • python311Packages.clip
  • python311Packages.clip-anytorch
  • python311Packages.clip-anytorch.dist
  • python311Packages.clip.dist
  • python311Packages.ctranslate2
  • python311Packages.ctranslate2.dist
  • python311Packages.detectron2
  • python311Packages.detectron2.dist
  • python311Packages.easyocr
  • python311Packages.easyocr.dist
  • python311Packages.effdet
  • python311Packages.effdet.dist
  • python311Packages.envisage
  • python311Packages.envisage.dist
  • python311Packages.fairseq
  • python311Packages.fairseq.dist
  • python311Packages.fastai
  • python311Packages.fastai.dist
  • python311Packages.faster-whisper
  • python311Packages.faster-whisper.dist
  • python311Packages.grad-cam
  • python311Packages.grad-cam.dist
  • python311Packages.invisible-watermark
  • python311Packages.invisible-watermark.dist
  • python311Packages.k-diffusion
  • python311Packages.k-diffusion.dist
  • python311Packages.langchain
  • python311Packages.langchain.dist
  • python311Packages.libretranslate
  • python311Packages.libretranslate.dist
  • python311Packages.manifest-ml
  • python311Packages.manifest-ml.dist
  • python311Packages.mayavi
  • python311Packages.mayavi.dist
  • python311Packages.mmcv
  • python311Packages.mmcv.dist
  • python311Packages.mmengine
  • python311Packages.mmengine.dist
  • python311Packages.nianet
  • python311Packages.nianet.dist
  • python311Packages.pytorch-lightning
  • python311Packages.pytorch-lightning.dist
  • python311Packages.pytorch-metric-learning
  • python311Packages.pytorch-metric-learning.dist
  • python311Packages.pytorch-pfn-extras
  • python311Packages.pytorch-pfn-extras.dist
  • python311Packages.sentence-transformers
  • python311Packages.sentence-transformers.dist
  • python311Packages.sfepy
  • python311Packages.sfepy.dist
  • python311Packages.skorch
  • python311Packages.skorch.dist
  • python311Packages.skrl
  • python311Packages.skrl.dist
  • python311Packages.spacy
  • python311Packages.spacy-loggers
  • python311Packages.spacy-loggers.dist
  • python311Packages.spacy-lookups-data
  • python311Packages.spacy-lookups-data.dist
  • python311Packages.spacy-transformers
  • python311Packages.spacy-transformers.dist
  • python311Packages.spacy.dist
  • python311Packages.tensorboardx
  • python311Packages.tensorboardx.dist
  • python311Packages.textacy
  • python311Packages.textacy.dist
  • python311Packages.textnets
  • python311Packages.textnets.dist
  • python311Packages.timm
  • python311Packages.timm.dist
  • python311Packages.tiny-cuda-nn
  • python311Packages.torch-tb-profiler
  • python311Packages.torch-tb-profiler.dist
  • python311Packages.torchinfo
  • python311Packages.torchinfo.dist
  • python311Packages.torchvision
  • python311Packages.torchvision.dist
  • python311Packages.translatehtml
  • python311Packages.translatehtml.dist
  • python311Packages.unstructured-inference
  • python311Packages.unstructured-inference.dist
  • python311Packages.wandb
  • python311Packages.wandb.dist
  • python311Packages.xformers
  • python311Packages.xformers.dist
246 packages built:
  • gwe
  • libretranslate (python310Packages.libretranslate)
  • libretranslate.dist (python310Packages.libretranslate.dist)
  • ocamlPackages.torch
  • openai-full
  • openai-full.dist
  • openai-whisper (python310Packages.openai-whisper)
  • openai-whisper.dist (python310Packages.openai-whisper.dist)
  • pianotrans
  • pianotrans.dist
  • python310Packages.accelerate
  • python310Packages.accelerate.dist
  • python310Packages.apptools
  • python310Packages.apptools.dist
  • python310Packages.argos-translate-files
  • python310Packages.argos-translate-files.dist
  • python310Packages.argostranslate
  • python310Packages.argostranslate.dist
  • python310Packages.ax
  • python310Packages.ax.dist
  • python310Packages.bitsandbytes
  • python310Packages.bitsandbytes.dist
  • python310Packages.blosc2
  • python310Packages.blosc2.dist
  • python310Packages.botorch
  • python310Packages.botorch.dist
  • python310Packages.ctranslate2
  • python310Packages.ctranslate2.dist
  • python310Packages.deepdish
  • python310Packages.deepdish.dist
  • python310Packages.deepwave
  • python310Packages.deepwave.dist
  • python310Packages.envisage
  • python310Packages.envisage.dist
  • python310Packages.experiment-utilities
  • python310Packages.experiment-utilities.dist
  • python310Packages.ezyrb
  • python310Packages.ezyrb.dist
  • python310Packages.fairscale
  • python310Packages.fairscale.dist
  • python310Packages.fairseq
  • python310Packages.fairseq.dist
  • python310Packages.faster-whisper
  • python310Packages.faster-whisper.dist
  • python310Packages.flammkuchen
  • python310Packages.flammkuchen.dist
  • python310Packages.flyingsquid
  • python310Packages.flyingsquid.dist
  • python310Packages.fvcore
  • python310Packages.fvcore.dist
  • python310Packages.gpytorch
  • python310Packages.gpytorch.dist
  • python310Packages.ignite
  • python310Packages.ignite.dist
  • python310Packages.iopath
  • python310Packages.iopath.dist
  • python310Packages.kornia
  • python310Packages.kornia.dist
  • python310Packages.layoutparser
  • python310Packages.layoutparser.dist
  • python310Packages.linear_operator
  • python310Packages.linear_operator.dist
  • python310Packages.lion-pytorch
  • python310Packages.lion-pytorch.dist
  • python310Packages.mayavi
  • python310Packages.mayavi.dist
  • python310Packages.mmengine
  • python310Packages.mmengine.dist
  • python310Packages.monai
  • python310Packages.monai.dist
  • python310Packages.nianet
  • python310Packages.nianet.dist
  • python310Packages.pandas-stubs
  • python310Packages.pandas-stubs.dist
  • python310Packages.pdfplumber
  • python310Packages.pdfplumber.dist
  • python310Packages.peft
  • python310Packages.peft.dist
  • python310Packages.pgmpy
  • python310Packages.pgmpy.dist
  • python310Packages.piano-transcription-inference
  • python310Packages.piano-transcription-inference.dist
  • python310Packages.pydmd
  • python310Packages.pydmd.dist
  • python310Packages.pynvml
  • python310Packages.pynvml.dist
  • python310Packages.pyro-ppl
  • python310Packages.pyro-ppl.dist
  • python310Packages.resize-right
  • python310Packages.resize-right.dist
  • python310Packages.rising
  • python310Packages.rising.dist
  • python310Packages.safetensors
  • python310Packages.safetensors.dist
  • python310Packages.shap
  • python310Packages.shap.dist
  • python310Packages.skorch
  • python310Packages.skorch.dist
  • python310Packages.slicer
  • python310Packages.slicer.dist
  • python310Packages.snorkel
  • python310Packages.snorkel.dist
  • python310Packages.spacy
  • python310Packages.spacy-loggers
  • python310Packages.spacy-loggers.dist
  • python310Packages.spacy-lookups-data
  • python310Packages.spacy-lookups-data.dist
  • python310Packages.spacy-transformers
  • python310Packages.spacy-transformers.dist
  • python310Packages.spacy.dist
  • python310Packages.speechbrain
  • python310Packages.speechbrain.dist
  • python310Packages.stanza
  • python310Packages.stanza.dist
  • python310Packages.stytra
  • python310Packages.stytra.dist
  • python310Packages.tables
  • python310Packages.tables.dist
  • python310Packages.test-tube
  • python310Packages.test-tube.dist
  • python310Packages.textacy
  • python310Packages.textacy.dist
  • python310Packages.textnets
  • python310Packages.textnets.dist
  • python310Packages.torch (python310Packages.torchWithCuda ,python310Packages.torchWithoutRocm)
  • python310Packages.torch.dev (python310Packages.torchWithCuda.dev ,python310Packages.torchWithoutRocm.dev)
  • python310Packages.torch.dist (python310Packages.torchWithCuda.dist ,python310Packages.torchWithoutRocm.dist)
  • python310Packages.torch.lib (python310Packages.torchWithCuda.lib ,python310Packages.torchWithoutRocm.lib)
  • python310Packages.torchaudio
  • python310Packages.torchaudio.dist
  • python310Packages.torchdiffeq
  • python310Packages.torchdiffeq.dist
  • python310Packages.torchgpipe
  • python310Packages.torchgpipe.dist
  • python310Packages.torchio
  • python310Packages.torchio.dist
  • python310Packages.torchlibrosa
  • python310Packages.torchlibrosa.dist
  • python310Packages.torchmetrics
  • python310Packages.torchmetrics.dist
  • python310Packages.torchsde
  • python310Packages.torchsde.dist
  • python310Packages.transformers
  • python310Packages.transformers.dist
  • python310Packages.translatehtml
  • python310Packages.translatehtml.dist
  • python310Packages.ttach
  • python310Packages.ttach.dist
  • python310Packages.wandb
  • python310Packages.wandb.dist
  • python311Packages.accelerate
  • python311Packages.accelerate.dist
  • python311Packages.bitsandbytes
  • python311Packages.bitsandbytes.dist
  • python311Packages.blosc2
  • python311Packages.blosc2.dist
  • python311Packages.deepdish
  • python311Packages.deepdish.dist
  • python311Packages.deepwave
  • python311Packages.deepwave.dist
  • python311Packages.experiment-utilities
  • python311Packages.experiment-utilities.dist
  • python311Packages.ezyrb
  • python311Packages.ezyrb.dist
  • python311Packages.fairscale
  • python311Packages.fairscale.dist
  • python311Packages.flammkuchen
  • python311Packages.flammkuchen.dist
  • python311Packages.flyingsquid
  • python311Packages.flyingsquid.dist
  • python311Packages.fvcore
  • python311Packages.fvcore.dist
  • python311Packages.gpytorch
  • python311Packages.gpytorch.dist
  • python311Packages.ignite
  • python311Packages.ignite.dist
  • python311Packages.iopath
  • python311Packages.iopath.dist
  • python311Packages.kornia
  • python311Packages.kornia.dist
  • python311Packages.layoutparser
  • python311Packages.layoutparser.dist
  • python311Packages.linear_operator
  • python311Packages.linear_operator.dist
  • python311Packages.lion-pytorch
  • python311Packages.lion-pytorch.dist
  • python311Packages.monai
  • python311Packages.monai.dist
  • python311Packages.pandas-stubs
  • python311Packages.pandas-stubs.dist
  • python311Packages.pdfplumber
  • python311Packages.pdfplumber.dist
  • python311Packages.peft
  • python311Packages.peft.dist
  • python311Packages.pgmpy
  • python311Packages.pgmpy.dist
  • python311Packages.pydmd
  • python311Packages.pydmd.dist
  • python311Packages.pynvml
  • python311Packages.pynvml.dist
  • python311Packages.pyro-ppl
  • python311Packages.pyro-ppl.dist
  • python311Packages.resize-right
  • python311Packages.resize-right.dist
  • python311Packages.rising
  • python311Packages.rising.dist
  • python311Packages.safetensors
  • python311Packages.safetensors.dist
  • python311Packages.slicer
  • python311Packages.slicer.dist
  • python311Packages.snorkel
  • python311Packages.snorkel.dist
  • python311Packages.speechbrain
  • python311Packages.speechbrain.dist
  • python311Packages.stanza
  • python311Packages.stanza.dist
  • python311Packages.tables
  • python311Packages.tables.dist
  • python311Packages.test-tube
  • python311Packages.test-tube.dist
  • python311Packages.torch (python311Packages.torchWithCuda ,python311Packages.torchWithoutRocm)
  • python311Packages.torch.dev (python311Packages.torchWithCuda.dev ,python311Packages.torchWithoutRocm.dev)
  • python311Packages.torch.dist (python311Packages.torchWithCuda.dist ,python311Packages.torchWithoutRocm.dist)
  • python311Packages.torch.lib (python311Packages.torchWithCuda.lib ,python311Packages.torchWithoutRocm.lib)
  • python311Packages.torchaudio
  • python311Packages.torchaudio.dist
  • python311Packages.torchdiffeq
  • python311Packages.torchdiffeq.dist
  • python311Packages.torchgpipe
  • python311Packages.torchgpipe.dist
  • python311Packages.torchio
  • python311Packages.torchio.dist
  • python311Packages.torchmetrics
  • python311Packages.torchmetrics.dist
  • python311Packages.torchsde
  • python311Packages.torchsde.dist
  • python311Packages.transformers
  • python311Packages.transformers.dist
  • python311Packages.ttach
  • python311Packages.ttach.dist
  • whisper-ctranslate2
  • whisper-ctranslate2.dist
  • wyoming-faster-whisper
  • wyoming-faster-whisper.dist
  • xpraWithNvenc
  • xpraWithNvenc.dist

@SomeoneSerge
Copy link
Contributor Author

Failed derivations
Details

@bcdarwin
Copy link
Member

I think a lot of these are new failures on master due to python311Packages.tensorboard having been enabled (maybe should have targeted staging). python310Packages.torchvision is probably the most concerning one (failing with CUDA-related errors).

@SomeoneSerge
Copy link
Contributor Author

RE: torchvision

Unbelievavble. This actually resulted in a WITH_CUDA=OFF build. The setup py even seems to ignore USE_CUDA=1. We really should invoke cmake directly

@SomeoneSerge
Copy link
Contributor Author

cmake_dependent_option(
    USE_CUDNN "Use cuDNN" ON
    "USE_CUDA" OFF)

This silently resets use_cuda to false. There's a bunch of other occasions where pytorch does that. The behaviour we'd like whenwe've set with_cuda but a dependency is missing is immediate failure

@SomeoneSerge SomeoneSerge changed the title python3Packages.torch: migrate to setupCudaHook WIP: python3Packages.torch: migrate to setupCudaHook Aug 2, 2023
@SomeoneSerge
Copy link
Contributor Author

Looking at the logs, this torch revision seems to ignore cmake_cudatoolkit_root. Maybe the release is still using the legacy findcuda. I guess I'll just come back to this in 2 weeks

@SomeoneSerge
Copy link
Contributor Author

Superseded by the much more thorough implementation in #249259!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants