Przejdź do treści
Biblioteka skilli
DevOps i chmura · Budowanie i kod

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.

Licencja
MIT
Ostatnia zmiana repozytorium
11.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 11.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

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

  1. The contract
  2. Choosing a container strategy
  3. CUDA pinning
  4. Enabling the GPU path
  5. Testing
  6. Verification
  7. Notes
Sekcje z nagłówków SKILL.md, w oryginale · 59 linii, 374 słów
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.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.