Install
$ agentstack add skill-gjbex-scientific-computing-skills-scientific-accelerator-portability ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
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--rocm
where 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.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: gjbex
- Source: gjbex/scientific-computing-skills
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.