Introduction¶
When using AI to design or review scientific computing and high-performance projects, it is easy to focus on “looking like some mature library” or “copying a specific use case” while neglecting reasoning grounded in computational contracts, resource constraints, and engineering overhead. HPC_Style_For_AI provides a set of general design principles so that AI starts from these principles when generating or reviewing code, before selecting specific mechanisms and implementation details.
Plugin Overview¶
- Skill name: hpc-style-for-ai
- Package name: dsh-hpc-style-for-ai
- Maintainer: WangZW928
- Category: Workflow
- Version: 0.3.1
- Compatible targets: DSH skills service 0.2.1-rc.5, Node.js 22+
- License: MIT (original code, probes, icons, and documentation); BSD-3-Clause (AMReX citation); Apache-2.0 with LLVM Exceptions (Kokkos citation)
Core Features¶
HPC_Style_For_AI organizes its content into three layers that AI reads on demand:
- Principles layer: Twelve general principles (G01–G12), organized by design questions (computational contract, cost and critical path, data representation and lifetime, execution timing and granularity, long-term engineering cost control, etc.). AI reads this layer by default; no project architecture is required to be replicated.
- Supplementary notes layer: Implementation notes on binding strategies, data independence/consistency/work completion, etc., loaded by design question, explaining decision conditions, alternative approaches, costs, and verification methods.
- Argumentation layer: Connections between principles and evidence, AMReX and Kokkos case studies and their evidence ledgers, used to support or constrain judgments rather than serve as a normative catalog.
The plugin does not force-inject rules into the global prompt; it registers the skill hpc-style-for-ai on demand.
Installation and Activation¶
Use the official install command, replacing web with the profile you actually use:
dsh plugin --profile web add https://github.com/WangZW928/HPC_Style_For_AI/releases/download/v0.3.1/dsh-hpc-style-for-ai-0.3.1.tgz
Check and pack from source:
git clone https://github.com/WangZW928/HPC_Style_For_AI.git
cd HPC_Style_For_AI
npm run check
npm pack
After installation, follow the host’s prompts to activate the skill, refresh the session, and inspect the skill directory. The actual loaded state takes precedence.
Typical Usage¶
In a DSH session, submit a concrete task to the skill entry point along with the principles it references by default. For example:
使用 hpc-style-for-ai 设计这个稀疏迭代求解流程。
先确定数值契约、重复使用的结构、数据运动与关键路径,
再选择预处理计划、数据表示和并行粒度。不要预设模板或某种执行框架。
说明每个重要选择的收益、代价和验证方法。
使用 hpc-style-for-ai 评审这段 Fortran/Python 科学计算流程。
从端到端成本、隐式复制、工作粒度、依赖与数值验证入手。
不要为了套用案例而更换语言或引入网格对象体系。
For dense computations, start from reuse and arithmetic intensity; for sparse or graph workloads, start from irregular access, preprocessing amortization, and long-tail effects; for repeated transformations, start from plan construction, reordering, and communication.
Applicable Scenarios and Caveats¶
- Suitable for: Developers who need AI-assisted design or review of scientific computing and high-performance projects and prefer to start from general principles rather than copy-paste use cases.
- Note: The plugin runs with the current DSH process permissions; you may review the source code and licenses (MIT, BSD-3-Clause, Apache-2.0 with LLVM Exceptions) before installing.
Conclusion¶
HPC_Style_For_AI provides a set of reusable, derivable design principles so that AI starts from computational contracts and engineering overhead when generating or reviewing HPC code, before selecting specific mechanisms and implementation details. After installation, simply register the skill on demand to begin using it.
- Directory page: https://www.skillhub.cn/plugins/WangZW928/HPC_Style_For_AI
- GitHub: https://github.com/WangZW928/HPC_Style_For_AI