Agent skill

GPU Backend

by joselado in joselado/pyqula

pyqula's CPU/GPU switch (src/pyqula/gpu.py), how a routine is routed onto the device, per-call precision, and the tiered porting plan in documentation/gpuportingplan.md.

GPL-3.0Auto-check passedAI & LLM Engineering

Install GPU Backend

skills CLI
$ npx skills add joselado/pyqula --skill gpu-backend -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install joselado/pyqula gpu-backend --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/joselado/pyqula.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/gpu-backend .claude/skills/gpu-backend && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
gpu-backend
GitHub stars
145
Token cost
~679 tokens
SKILL.md length
309 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
GPL-3.0

At a glance

pyqula's CPU/GPU switch (src/pyqula/gpu.py), how a routine is routed onto the device, per-call precision, and the tiered porting plan in documentation/gpuportingplan.md.

  • Tasks that involve Deep learning
  • SKILL.md covers One package-wide switch, The porting plan, and the… and What the GPU is actually good…
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

GPU Backend is an agent skill from joselado/pyqula. pyqula's CPU/GPU switch (src/pyqula/gpu.py), how a routine is routed onto the device, per-call precision, and the tiered porting plan in documentation/gpuportingplan.md. Load this before moving any compute onto the GPU, before adding a jax code path, before touching kpmtk/kpmjax.py, htk/eigenvectorsjax.py or any other jax.py module, and whenever a task mentions the GPU, CUDA, the device, jax, or making something faster by moving it off the CPU. Each tier of the porting plan wants the maintainer's sign-off before…

Its SKILL.md is about 680 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Deep learning. It works with CUDA. The repository describes itself as: Python library to compute properties of quantum tight binding models, including topological, electronic and magnetic properties and including the effect of many-body interactions. The licence is GPL-3.0.

When your agent uses it

  • Tasks that involve Deep learning

Example prompts

  • “/gpu-backend”

What it can do on your machine

Read from SKILL.md and the folder at commit a61709a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

GPU Backend loads about 679 tokens when it runs. Until then it costs about 151 tokens; SKILL.md has 309 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~151
When it runs · the whole SKILL.md, loaded when a task matches
~679

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from joselado/pyqula at commit a61709a, republished under its GPL-3.0 licence (© joselado). 309 words, ~679 tokens.

Download SKILL.mdSave it as .claude/skills/gpu-backend/SKILL.md (or your agent's skills folder).
name
gpu-backend
description
pyqula's CPU/GPU switch (src/pyqula/gpu.py), how a routine is routed onto the device, per-call precision, and the tiered porting plan in documentation/gpu_porting_plan.md. Load this before moving any compute onto the GPU, before adding a jax code path, before touching kpmtk/kpmjax.py, htk/eigenvectorsjax.py or any other *jax.py module, and whenever a task mentions the GPU, CUDA, the device, jax, or making something faster by moving it off the CPU. Each tier of the porting plan wants the maintainer's sign-off before it starts, so check here before proposing GPU work rather than after.

The GPU backend

One package-wide switch

The CPU/GPU backend is one switch, src/pyqula/gpu.py. gpu.set_gpu(True) puts every GPU-capable routine on the device and points jax's default device there, so the jax modules with no backend branch of their own follow it too. The default is the CPU, on every machine.

A new GPU path routes on gpu.get_gpu() rather than growing a switch of its own. Precision stays per-call: kpm_prec, chi_prec, eigh_prec. The old per-call kpm_cpugpu and chi_cpugpu arguments were removed and now raise.

Importing gpu.py switches jax to double precision (jax_enable_x64) for the whole process, and that is the only place it is set. A new jax module imports gpu before it creates any jax array, rather than setting x64 itself: when eleven modules each set it at import, the jax code that did not ran in single or double precision depending on import order.

The porting plan, and the sign-off rule

documentation/gpu_porting_plan.md is the maintainer-facing roadmap for moving compute-heavy paths onto GPU via jax, which is already a hard dependency. Read it before starting any GPU-related work in this repo.

TierWhatState
1The batched KPM GPU path (kpmtk/kpmjax.py, kpmtk/kpmnumba.py)done
2Batched dense diagonalization (htk/eigenvectorsjax.py)done
3Scoping the forced-CPU jax modulesdone
4Why sparse/ARPACK-based Green's-function work is harder and lower prioritynot started

Each tier wants explicit sign-off before it starts. Propose, do not begin.

What the GPU is actually good for here

The shape that pays on the device is a batched dense solve: many independent matrices diagonalized or multiplied at once, large enough that the transfer is amortized. Single sparse solves and ARPACK-style iterative work are the unfavourable case, which is why tier 4 sits where it does.

Performance conclusions belong in the tracked roadmaps. The hostnames, scratch paths and job IDs that produced them do not -- see the HPC rule in CLAUDE.md.

© joselado, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/gpu-backend of joselado/pyqula.

Open the folder on GitHubat commit a61709a

Compare with similar skills

GPU Backend next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

GPU Backend compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
GPU Backend this skilljoselado/pyqula145—~679Automated safety check: PassGPL-3.0
MUSA GPU Training Optimizeropen-infra-skills/infra-skills141—~1.7kAutomated safety check: PassApache-2.0
DGX Spark Training Gotchaswshobson/agents40k1 repos~2kAutomated safety check: PassMIT
Megatron-LM on SLURMNVIDIA/Megatron-LM18k—~1.8kAutomated safety check: PassApache-2.0
Extending Ocannlahrefs/ocannl118—~728Automated safety check: PassBSD-2-Clause
Mamba State-Space ModelsOrchestra-Research/AI-Research-SKILLs13k3 repos~1.8kAutomated safety check: PassMIT

Similar skills

  • MUSA GPU Training Optimizer

    open-infra-skills/infra-skills

    Profiles, benchmarks and tunes AI training workloads on Moore Threads MUSA GPUs with a measurement-first process that keeps model behavior unchanged.

    141 GitHub stars~1.7k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • Preflight checks and diagnosis for ten known failure modes of ML training on NVIDIA DGX Spark's GB10, spanning launch errors, memory, thermals, bandwidth and precision.

    40k GitHub starsUsed in 1 repo~2k tokens
    AI & LLM EngineeringAuto-check passed
  • Megatron-LM on SLURM

    NVIDIA/Megatron-LM

    Official

    Shows how to launch distributed Megatron-LM training on a SLURM cluster: sbatch skeleton, torch.distributed.run setup, CUDA_DEVICE_MAX_CONNECTIONS rules and failure diagnosis.

    18k GitHub stars~1.8k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Extending Ocannl

    ahrefs/ocannl

    Touch-lists for common OCANNL extension tasks: adding a primitive operation, adding or extending a backend, extending shape inference, and diagnosing output differences between backends.

    118 GitHub stars~728 tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Mamba State-Space Models

    Orchestra-Research/AI-Research-SKILLs

    Guide to using Mamba selective state-space models for linear-time sequence modeling, from the Mamba block and pretrained checkpoints to Mamba-2 and speed comparisons.

    13k GitHub starsUsed in 3 repos~1.8k tokens
    AI & LLM EngineeringAuto-check passed
  • GPU Optimizer

    Mathews-Tom/armory

    GPU optimization for consumer NVIDIA GPUs (8-24GB VRAM) covering mixed precision, gradient checkpointing, XGBoost GPU, CuPy/cuDF migration, and torch.compile.

    328 GitHub stars~3.5k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check: notes

More from joselado/pyqula

  • Refresh Docs

    joselado/pyqula

    Refresh pyqula's documentation after a change - recount the test suite, propagate every number that moved, re-run the static user-guide checks, and rebuild documentation/userguide.pdf.

    145 GitHub stars~816 tokensUpdated yesterday
    Auto-check passed
  • Error Conventions

    joselado/pyqula

    How pyqula raises errors -- which exception type for which failure, the registries behind string-selected options (mode=, solver=, channel=, operator names), and the shared Hilbert-space guards in…

    145 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • New Feature

    joselado/pyqula

    The completeness checklist for adding a user-facing feature to pyqula - where the implementation goes, what kind of test it needs, and the five documentation surfaces that must move with it.

    145 GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • User Guide Voice

    joselado/pyqula

    The maintainer's writing voice for documentation/userguide.md -- the three registers (chapter prose, section intros, catalogue bullets), the spelling decisions, what not to write, and which chapters…

    145 GitHub stars~985 tokensUpdated yesterday
    Auto-check passed
  • Wannierization

    joselado/pyqula

    pyqula's Wannierization (wanniertk/), what h.getwannierhamiltonian() returns, the disentanglement window keywords and which combinations raise NotImplementedError, and the bundled pure-Python…

    145 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about GPU Backend

What does GPU Backend do?

pyqula's CPU/GPU switch (src/pyqula/gpu.py), how a routine is routed onto the device, per-call precision, and the tiered porting plan in documentation/gpuportingplan.md. GPU Backend is an agent skill from joselado/pyqula.md.

When should I use GPU Backend?

GPU Backend fits situations like: tasks that involve Deep learning.

How do I install GPU Backend in Claude Code?

Run `npx skills add joselado/pyqula --skill gpu-backend -a claude-code`. Or copy the skill folder (.claude/skills/gpu-backend in joselado/pyqula) into .claude/skills/gpu-backend in your project. Claude Code loads it when a task matches its description.

How do I install GPU Backend in Codex?

Run `npx skills add joselado/pyqula --skill gpu-backend -a codex`. Or copy the skill folder (.claude/skills/gpu-backend in joselado/pyqula) into .agents/skills/gpu-backend in your project. Codex loads it when a task matches its description.

Can I use GPU Backend in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add joselado/pyqula --skill gpu-backend -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gpu-backend, .gemini/skills/gpu-backend, .github/skills/gpu-backend and .opencode/skills/gpu-backend in your project.

What does GPU Backend need to run?

SKILL.md names no scripts, command-line tools or credentials: GPU Backend is instructions for the agent only.

Does GPU Backend access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is GPU Backend safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does GPU Backend use?

GPU Backend is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does GPU Backend use?

About 679 tokens (SKILL.md is roughly 2.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to GPU Backend?

Skills that share tags, products or a category with GPU Backend: MUSA GPU Training Optimizer (open-infra-skills/infra-skills, 141 stars), DGX Spark Training Gotchas (wshobson/agents, 40k stars), Megatron-LM on SLURM (NVIDIA/Megatron-LM, 18k stars) and Extending Ocannl (ahrefs/ocannl, 118 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains GPU Backend?

joselado (a GitHub user) maintains it in joselado/pyqula, which has 145 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 7, 2026.

Source: joselado/pyqula on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.