scientific-accelerator-portability
Skill1 starsChanged 6 months agoApache-2.0View on GitHub
Review and improve GPU and accelerator scientific code for
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- developer-tool-installation-policySkill
- git-refactor-hygieneSkill
- project-repository-setupSkill
- scientific-build-systemsSkill
- scientific-ciSkill
- scientific-cli-benchmarkSkill
- scientific-cli-designSkill
- scientific-code-styleSkill
- scientific-container-workflowsSkill
- scientific-data-analysis-and-visualizationSkill
- scientific-data-managementSkill
- scientific-documentationSkill
- scientific-io-and-data-formatsSkill
- scientific-notebook-workflowsSkill
- scientific-numerics-reviewSkill
- scientific-package-managementSkill
- scientific-parallel-debuggingSkill
- scientific-performance-portabilitySkill
- scientific-profilingSkill
- scientific-release-and-publicationSkill
- scientific-reproducibilitySkill
- scientific-reviewSkill
- scientific-testingSkill
- scientific-workflow-automationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
41 rules. About 0 are common, 36 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈36
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill when scientific code targets GPUs or other accelerators and must remain correct, maintainable, and reasonably portable …
- Distinctive: line 28
Use this skill when:
- Very specific: line 38
Do not use this skill as a substitute for benchmarking or profiling.
- Distinctive: line 44
When this skill applies:
- Distinctive: line 46
Read the repository AGENTS.md first, if present.
- Distinctive: line 55
Prefer portable abstractions and explicit backend boundaries before adding vendor-specific special cases.
- Distinctive: line 60
Use a portability layer such as Kokkos, RAJA, SYCL, OpenMP offload, or OpenACC when the project already depends on it or needs multi-vendor …
- Distinctive: line 62
Use CUDA or HIP directly when the project deliberately targets that backend and the maintenance cost is accepted.
- Distinctive: line 64
Keep backend-specific code isolated behind capability checks, build options, or narrow implementation files.
- Distinctive: line 66
Avoid mixing unrelated accelerator models in one code path without a clear abstraction boundary.
- Distinctive: line 68
Document which backend is primary and which are best-effort.
- Distinctive: line 78
Ensure tests cover fallback paths, not only the fastest accelerator path.
- Distinctive: line 79
Avoid silently changing scientific behavior when falling back to CPU or a different precision.
- Distinctive: line 81
Document when no fallback exists and why.
- Distinctive: line 88
Keep ownership and lifetime of device data explicit.
- Distinctive: line 89
Avoid hidden synchronization unless it is required for correctness.
- Distinctive: line 90
Check that memory layout matches access patterns for the target backend.
- Distinctive: line 93
Treat out-of-memory behavior and allocation failures as expected failure modes, not impossible states.
- Distinctive: line 100
Check whether the accelerator path changes precision, reduction order, math-library implementation, or fused operations.
- Distinctive: line 102
Use tolerances justified by algorithm, scale, backend, and reduction behavior.
- Distinctive: line 104
Avoid assuming bitwise equality across GPU models, compiler versions, or math libraries unless the project explicitly enforces it.
- Distinctive: line 106
Document when backend-specific numerical drift is expected.
- Very specific: line 108
Use scientific-numerics-review for deeper numerical stability and tolerance analysis.
- Distinctive: line 113
Keep accelerator backend selection explicit in CMake, package metadata, or build scripts.
- Distinctive: line 115
Avoid hardcoding one CUDA architecture, GPU name, compiler path, or SDK install location as a global default.
- Very specific: line 122
Use scientific-build-systems for implementation details in compiled build configuration.
- Distinctive: line 127
Document host driver and runtime requirements for GPU containers.
- Distinctive: line 128
Do not assume the container fully owns the GPU software stack.
- Distinctive: line 131
Keep workflow profiles explicit about accelerator requirements.
- Very specific: line 134
Use scientific-container-workflows and scientific-workflow-automation for container and workflow integration.
- Distinctive: line 139
Keep CPU/fallback tests in ordinary CI when accelerator runners are unavailable.
- Distinctive: line 141
Add accelerator smoke tests only when suitable runners or self-hosted infrastructure are available.
- Distinctive: line 144
Test small deterministic inputs before performance-sized workloads.
- Distinctive: line 145
Check both correctness and device selection behavior.
- Distinctive: line 152
Do not overfit launch dimensions, block sizes, vector widths, or tile sizes to one GPU generation without measurement.
- Distinctive: line 154
Prefer tunable parameters when one fixed value is unlikely to generalize.
- Very specific: line 161
Use scientific-performance-portability for broader non-accelerator portability tradeoffs.
- Distinctive: line 177
Run a tiny correctness case on CPU/fallback and accelerator paths when available.
- Distinctive: line 179
Check device discovery or backend-selection output.
- Distinctive: line 182
If no accelerator is available, state that only static/build-level checks were performed.
- Distinctive: line 187
When using this skill, briefly note:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Scientific Accelerator Portability
Use this skill when scientific code targets GPUs or other accelerators and must remain correct, maintainable, and reasonably portable across hardware, compilers, drivers, and execution environments.
Repository AGENTS.md instructions take precedence over this skill.
Purpose
Apply a pragmatic default for:
- separating portable accelerator abstractions from backend-specific code;
- preserving CPU or non-accelerated fallback paths where practical;
- documenting hardware, driver, compiler, and runtime assumptions;
- testing correctness across backend and precision differences;
- avoiding overfitting to one GPU generation, vendor, or cluster.
When To Use
Use this skill when:
- code uses CUDA, HIP, SYCL, OpenACC, OpenMP offload, Kokkos, RAJA, OpenCL, or accelerator-specific libraries;
- a CPU implementation is being ported to GPU or accelerator hardware;
- code must run on more than one accelerator backend or hardware generation;
- performance changes alter data movement, precision, launch shape, or memory layout;
- CI, containers, or workflows need accelerator-aware smoke tests.
Do not use this skill as a substitute for benchmarking or profiling. Use
scientific-cli-benchmark and scientific-profiling to measure behavior, then
use this skill to reason about portability and fallback tradeoffs.
Working Approach
When this skill applies:
- Read the repository
AGENTS.mdfirst, if present. - Identify the accelerator backend, target hardware, compiler, driver, and runtime assumptions.
- Find the baseline implementation and expected scientific outputs.
- Preserve or document fallback behavior before specializing.
- Review correctness, data movement, memory layout, precision, and launch assumptions together.
- State which backends or devices were considered, tested, and left untested.
Prefer portable abstractions and explicit backend boundaries before adding vendor-specific special cases.
Backend Strategy
- Use a portability layer such as Kokkos, RAJA, SYCL, OpenMP offload, or OpenACC when the project already depends on it or needs multi-vendor support.
- Use CUDA or HIP directly when the project deliberately targets that backend and the maintenance cost is accepted.
- Keep backend-specific code isolated behind capability checks, build options, or narrow implementation files.
- Avoid mixing unrelated accelerator models in one code path without a clear abstraction boundary.
- Document which backend is primary and which are best-effort.
Portability should be a design choice, not an accidental collection of compiler branches.
Fallback Paths
- Preserve a CPU or serial fallback when practical.
- Make fallback selection explicit through build options, runtime detection, or documented configuration.
- Ensure tests cover fallback paths, not only the fastest accelerator path.
- Avoid silently changing scientific behavior when falling back to CPU or a different precision.
- Document when no fallback exists and why.
A slow correct fallback is often valuable for validation and portability.
Data Movement and Memory
- Minimize host-device transfers in hot paths.
- Keep ownership and lifetime of device data explicit.
- Avoid hidden synchronization unless it is required for correctness.
- Check that memory layout matches access patterns for the target backend.
- Be explicit about unified memory, pinned memory, managed memory, and device allocations.
- Treat out-of-memory behavior and allocation failures as expected failure modes, not impossible states.
Data movement mistakes can dominate performance and obscure correctness bugs.
Precision and Numerical Behavior
- Check whether the accelerator path changes precision, reduction order, math-library implementation, or fused operations.
- Use tolerances justified by algorithm, scale, backend, and reduction behavior.
- Compare accelerator and CPU outputs on small deterministic cases.
- Avoid assuming bitwise equality across GPU models, compiler versions, or math libraries unless the project explicitly enforces it.
- Document when backend-specific numerical drift is expected.
Use scientific-numerics-review for deeper numerical stability and tolerance
analysis.
Build and Configuration
- Keep accelerator backend selection explicit in CMake, package metadata, or build scripts.
- Avoid hardcoding one CUDA architecture, GPU name, compiler path, or SDK install location as a global default.
- Support architecture lists or configurable target capabilities when reasonable.
- Separate required accelerator dependencies from optional acceleration.
- Fail clearly when a requested backend is unavailable.
Use scientific-build-systems for implementation details in compiled build
configuration.
Containers and Workflows
- Document host driver and runtime requirements for GPU containers.
- Do not assume the container fully owns the GPU software stack.
- For Apptainer/Singularity, document GPU flags such as
--nvor--rocmwhere relevant. - Keep workflow profiles explicit about accelerator requirements.
- Provide tiny accelerator smoke tests before large GPU runs.
Use scientific-container-workflows and scientific-workflow-automation for
container and workflow integration.
CI and Testing
- Keep CPU/fallback tests in ordinary CI when accelerator runners are unavailable.
- Add accelerator smoke tests only when suitable runners or self-hosted infrastructure are available.
- Mark GPU-specific tests clearly so they can be skipped or selected.
- Test small deterministic inputs before performance-sized workloads.
- Check both correctness and device selection behavior.
CI should not pretend to validate accelerator support if no accelerator is available.
Performance Portability
- Do not overfit launch dimensions, block sizes, vector widths, or tile sizes to one GPU generation without measurement.
- Prefer tunable parameters when one fixed value is unlikely to generalize.
- Distinguish occupancy, bandwidth, latency, transfer, and synchronization bottlenecks.
- Record hardware model, driver, compiler, runtime, and input shape for benchmark claims.
- Preserve maintainability unless the specialization has measured value.
Use scientific-performance-portability for broader non-accelerator
portability tradeoffs.
Anti-Patterns
- making the accelerator path the only tested implementation;
- hiding backend selection in local environment variables;
- hardcoding one user's CUDA, ROCm, or compiler install path;
- assuming all GPUs support the same precision, atomics, memory, or libraries;
- committing code that only works on one cluster without documenting why;
- treating a successful kernel launch as proof of scientific correctness;
- using GPU timing without synchronizing or accounting for data transfer.
Validation Defaults
- Build or configure the requested backend when practical.
- Run a tiny correctness case on CPU/fallback and accelerator paths when available.
- Check device discovery or backend-selection output.
- Compile or run tests for fallback behavior.
- Record which hardware, compiler, driver, and backend were actually tested.
- If no accelerator is available, state that only static/build-level checks were performed.
Output Expectations
When using this skill, briefly note:
- which backend, hardware, compiler, driver, and runtime assumptions were considered;
- whether CPU/fallback behavior exists and was tested;
- what correctness, tolerance, data-movement, or configuration risks were addressed;
- which accelerator smoke tests, builds, or benchmarks were run;
- what remains backend-specific, hardware-specific, or untested.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

