AGENT SKILL

fastmri

Use fastMRI for MRI reconstruction data loading, MRI operators, reconstruction models, Lightning training, evaluation, and submission preparation.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
fastmri
license
MIT
metadata
{ "disco-role": "operating" }
description
Use fastMRI for MRI reconstruction data loading, MRI operators, reconstruction models, Lightning training, evaluation, and submission preparation.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

fastMRI

Use this repo skill when a task involves the fastmri Python package, fastMRI HDF5 k-space data, MRI reconstruction baselines, U-Net/VarNet models, PyTorch Lightning training, or fastMRI metric/submission-style outputs.

This skill targets the packaged fastmri library and selected self-contained workflows distilled from the repository examples. It assumes the user provides local fastMRI-style HDF5 data, checkpoints, and any optional external tools; it does not download datasets, model weights, or BART automatically.

Start Here

  1. Confirm the active Python can import fastmri; for data/model workflows also confirm torch, h5py, pytorch_lightning, torchmetrics, and requests if fastmri.data is imported.
  2. Identify the task family from the route table below, then open the matching sub-skill before writing code or commands.
  3. Keep original fastMRI data/checkpoints outside the skill; use bundled scripts only as helpers and generate user outputs in user-specified locations.
  4. Prefer CPU-safe smoke checks and tiny fixtures before long training, GPU inference, external downloads, or leaderboard packaging.

Sub-Skill Routes

User intent Read
Inspect .h5 keys, choose singlecoil vs multicoil, build SliceDataset/CombinedSliceDataset, configure masks/transforms, or debug cache/sample-rate issues. data-loading
Use complex tensor conventions, centered FFT/IFFT, rss, crop/normalization helpers, SSIMLoss, or array metric shape checks. mri-operators
Instantiate/debug U-Net, VarNet, NormUnet, AdaptiveVarNet, LOUPE/policy modules, tiny model shape checks, or offline pretrained inference. model-architectures
Build PyTorch Lightning train/test workflows with FastMriDataModule, UnetModule, VarNetModule, checkpoints, CPU fast-dev, DDP, or combine_train_val. lightning-training
Save reconstructions, validate prediction HDF5 files, compute MSE/NMSE/PSNR/SSIM, build zero-filled baselines, convert v2 filenames, or prepare submission outputs. evaluation-submission

Shared References and Scripts

  • Package overview summarizes package scope, installed dependency facts, selected examples, and advanced/example-only branches.
  • Troubleshooting covers cross-cutting install/import, optional dependency, data, backend, and workflow failure modes.
  • Repo provenance records the source commit, package version, dirty-state baseline, and evidence paths used to create this skill.
  • Routing metadata provides structured scenario placement for managed repo-skills-router import.
  • Environment check script prints a JSON import/backend/dependency summary for the active Python environment.

Common Task Patterns

Important Caveats

  • The package metadata declares core dependencies but this checkout's fastmri.data also imports requests; install requests if ModuleNotFoundError: requests appears.
  • The README notes a historical h5py/HDF5 memory leak concern for tensor conversion; if users see memory growth during large HDF5 reads, prefer a conda h5py build with an older compatible HDF5 as described in the package docs.
  • The repository examples often assume GPU/DDP defaults, repo-local fastmri_dirs.yaml, public checkpoint downloads, or separate pinned environments. The skill distills those workflows into explicit-path, offline-safe guidance instead of depending on original example files.
  • banding_removal/, BART compressed sensing, adaptive VarNet, feature VarNet, RadiologyJohnson2022, notebooks, annotation visualization, external prostate data/code, and raw data manifests are reference or advanced evidence unless a user explicitly asks for those areas and accepts their extra dependencies.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351