model-architecture
Inspect and configure HRM ACT v1 model internals, losses, FlashAttention layers, and dynamic model identifiers.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
01 前言 Front Matter
- name
- model-architecture
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Inspect and configure HRM ACT v1 model internals, losses, FlashAttention layers, and dynamic model identifiers.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/api-reference.md3.5 KB
- 参考文档references/architecture.md3.2 KB
- 参考文档references/troubleshooting.md3.2 KB
03 SKILL.md 正文
HRM Model Architecture
Use this sub-skill when the task is to understand, configure, inspect, or debug the Hierarchical Reasoning Model (HRM) ACT v1 implementation rather than to run full training.
When to use
- The user asks about HRM high-level/low-level recurrent modules, ACT halting, Q heads, carry state, sparse puzzle embeddings, StableMax loss, or FlashAttention-backed attention blocks.
- A config mentions
arch.name=hrm.hrm_act_v1@HierarchicalReasoningModel_ACTV1orarch.loss.name=losses@ACTLossHead. - A model import fails because
flash_attn,flash_attn_interface,adam_atan2_backend, CUDA, or dynamicmodule@classidentifiers are wrong. - The user needs to alter hidden size, heads, cycles, layers, positional encodings, halt steps, or loss type safely.
Route map
- Read references/architecture.md for the HRM ACT v1 object graph, carry objects, input/output tensors, and halting mechanics.
- Read references/api-reference.md for verified config fields, function/class signatures, losses, and dynamic identifier rules.
- Read references/troubleshooting.md for import/backend/config errors.
- Run scripts/inspect_model_config.py to inspect identifiers and optionally run CUDA dependency smokes from an HRM checkout.
Critical facts
- The default architecture config uses
hrm.hrm_act_v1@HierarchicalReasoningModel_ACTV1wrapped bylosses@ACTLossHeadwithloss_type=stablemax_cross_entropy. models/layers.pyimports FlashAttention at module import time. If neitherflash_attn_interfacenorflash_attnis importable, HRM model imports fail.pretrain.pyimportsAdamATan2fromadam_atan2; real training requires the compiledadam_atan2_backendCUDA extension.- Real model construction and forward execution are CUDA-oriented. CPU imports and source inspection are useful for config facts but do not verify the required training/evaluation backend.
- The repository's tiny model smoke under current dependency versions exposed a
runtime issue where FlashAttention output may be non-contiguous and
models/layers.pycalls.view(...); use this as troubleshooting evidence if a forward pass fails with a stride/view error.
Boundaries
- This sub-skill owns model/loss/config/API understanding and environment smokes for model dependencies.
- Use
data-preparationfor dataset schema, builders, and visualization. - Use
training-evaluationfor Hydra training commands, checkpoint evaluation, W&B, and ARC post-processing. - Do not present a CPU import as proof that HRM can train or evaluate. The backend gate is CUDA + FlashAttention + adam-atan2 backend.
Bounded inspection
From an HRM checkout, run:
python <skill>/sub-skills/model-architecture/scripts/inspect_model_config.py \
--repo-root /path/to/HRM --json
If a CUDA environment is prepared and the user wants dependency readiness:
python <skill>/sub-skills/model-architecture/scripts/inspect_model_config.py \
--repo-root /path/to/HRM --cuda-smoke
The helper verifies imports and dependency smokes. It intentionally avoids long training and does not require real datasets or checkpoints.
04 同仓库更多 Skills
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.