nf-core-gpu-module
/nf-core-gpu-module
Pisze lub adaptuje moduł nf-core do uruchamiania na GPU: dyrektywę akceleratora, ext.use_gpu, kontenery CPU i GPU oraz testy.
- Autor
- sci-kai ↗
- Repozytorium
- opencode-bioinfo-kit ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 11.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 1
Brak sygnałów. Repozytorium zmienione 11.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Pisze lub adaptuje moduł nf-core do uruchamiania na GPU: dyrektywę akceleratora, ext.use_gpu, kontenery CPU i GPU oraz testy.
Argumenty
/nf-core-gpu-module Module name and the GPU-capable tool/package
Oryginalny opis (EN)
Write or adapt an nf-core module for GPU execution: the accelerator directive contract, ext.use_gpu, dual CPU/GPU containers, CUDA pinning, and GPU test configuration. Use when a tool has a GPU code path or a module must run on GPU nodes.
Jak działa
- The contract
- Choosing a container strategy
- CUDA pinning
- Enabling the GPU path
- Testing
- Verification
- Notes
Podgląd SKILL.md
---
name: nf-core-gpu-module
description: 'Write or adapt an nf-core module for GPU execution: the accelerator directive contract, ext.use_gpu, dual CPU/GPU containers, CUDA pinning, and GPU test configuration. Use when a tool has a GPU code path or a module must run on GPU nodes.'
argument-hint: 'Module name and the GPU-capable tool/package'
user-invocable: true
---
# GPU-Enabled Modules
**Canonical guide:** <https://nf-co.re/docs/developing/components/gpu-modules>
## The contract
A module **never sets** the `accelerator` directive itself. The *pipeline* requests GPUs by
setting `accelerator = 1` in its process config; the module only *reacts* to `task.accelerator`.
This keeps modules usable on CPU-only infrastructure.
## Choosing a container strategy
- **Single container** — GPU support adds little size, or one image covers both paths.
- **Dual container** — the GPU variant is substantially larger (a CUDA PyTorch image can add ~3 GB). Switch on `task.accelerator`:
```groovy
conda "${ task.accelerator ? "${moduleDir}/environment.gpu.yml" : "${moduleDir}/environment.yml" }"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
(task.accelerator ? '<singularity-gpu-url>' : '<singularity-cpu-url>') :
(task.accelerator ? '<docker-gpu-url>' : '<docker-cpu-url>') }"
```
- **Vendor container** (proprietary, no conda equivalent) — guard against conda profiles so a conda run fails with a clear message instead of silently running the wrong thing.
## CUDA pinning
Pin `cuda-version` exactly. The pin sets the **minimum NVIDIA driver version required on the
host**, so choose the lowest value the GPU package actually supports on conda-forge:
```yaml
dependencies:
- "conda-forge::pytorch-gpu=2.1.0"
- "conda-forge::cuda-version=11.2"
```
Check the target cluster's driver version before pinning — a pin above what the nodes provide
makes the module unrunnable there.
## Enabling the GPU path
- Use `ext.use_gpu` (set by the pipeline in `conf/modules.config`) to pass the tool's own GPU flag through `ext.args`, rather than branching inside the script body where possible.
- Set `maxForks = 1` on GPU processes to prevent Singularity deadlocks when several tasks share one GPU.
## Testing
- Write a separate `tests/main.gpu.nf.test` for dual-mode modules.
- Tag GPU tests `"gpu"` (or `"gpu_highmem"`) so CI can select or skip them.
- Ship a `tests/nextflow.gpu.config` that sets `accelerator = 1`.
- Use the **same assertions** as the CPU test — the point is proving GPU and CPU paths produce equivalent results.
## Verification
- `nf-core modules lint <name>` clean.
- CPU test passes on a machine without a GPU (the module must not require one).
- GPU test passes where hardware is available, or is explicitly reported as untestable in this environment with the reason.
## Notes
- Running GPU workloads inside containers on CUBI infrastructure has known quirks — check the CUBI hints knowledge base (`~/.config/opencode/cubi-kb/hints-kb-agents-instructions.md`) before debugging from scratch.
Wersje
W bazie nie ma innych skilli o nazwie nf-core-gpu-module.
Migawka bazy z 13.11.2026 · wersja paczki e586aab2673d (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100gpu-accelerator-configuration-validation
Prowadzi wstępną walidację konfiguracji GPU w Kubernetes przed zadaniem: device plugin, requests i limits, tolerations, profile MIG oraz zgodność sterownika z CUDA, by zadanie nie spadło po cichu na CPU. - 100nf-core-ext-args
Konfiguruje zachowanie modułu przez konwencję ext.* w conf/modules.config, zamiast edytować kod modułu, np. flagi i warunki. - 95flox-cuda
Pomaga w konfiguracji CUDA i rozwoju na GPU w Flox: frameworki deep learning, cuDNN i środowiska CPU oraz GPU. - 96gpu-use
Sprawdza na zdalnym serwerze zużycie GPU: pamięć każdej karty, działające procesy i należące do nich kontenery. - 100nf-core-module-create
Tworzy nowy moduł lub podprzepływ nf-core od zera poleceniem nf-core modules create, z main.nf, meta.yml i testami nf-test. - 100gpu-containers
Konfiguruje środowiska Docker dla obciążeń GPU: dostęp do runtime NVIDIA i AMD, dobór obrazów bazowych i walidację uruchomienia na jednym lub wielu GPU z CUDA, ROCm, PyTorch i TensorFlow.