소스 정보
- 저장소
- ROCm/ATOM
- 최근 소스 활동
- 2026년 5월 23일 16:05
- 감지된 SKILL.md 언어
- 영어
- 스타
- 172
- 포크
- 141
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
SOC 직업 분류 기준
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/ROCm/ATOM --skill atom-patterns명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | atom-patterns |
| description | Coding patterns and architecture index for the ATOM LLM inference engine |
| version | 1.2.0 |
| scope | ATOM repo on AMD ROCm |
| last_updated | 2026-05-20T00:00:00.000Z |
atom/
├── config.py # Config, QuantizationConfig, HF config loading
├── entrypoints/ # Server entry (openai_server.py)
├── examples/ # simple_inference.py (offline smoke test)
├── model_engine/ # Core engine pipeline
│ ├── llm_engine.py # Top-level engine
│ ├── engine_core.py # Per-DP-rank loop
│ ├── scheduler.py # Batch scheduling
│ └── model_runner.py # Forward pass, CUDAGraph, KV cache binding
├── model_loader/
│ └── loader.py # Weight loading (safetensors, FP8/FP4, WeightsMapper)
├── model_ops/ # AITER kernel wrappers
│ ├── linear.py # LinearBase, ColumnParallel, RowParallel
│ ├── moe.py # FusedMoE, Mxfp4MoEMethod, weight_loader
│ ├── fused_moe_triton.py # Triton matmul_ogs MoE path
│ ├── attention_mla.py # MLA attention (DeepSeek)
│ ├── attention_mha.py # Standard MHA attention
│ └── paged_attention.py # Paged attention backend
├── models/ # Model implementations (one file per family;
│ # `*_mtp.py` for MTP / speculative variants —
│ # run `ls atom/models/` for the current set)
├── spec_decode/
│ └── eagle.py # MTP proposer (speculative decoding)
├── plugin/ # vLLM/SGLang plugin adapters
└── utils/
├── envs.py # All ATOM_* env var definitions
└── forward_context.py # Module-level forward context
Every model class follows this contract:
class NewModelForCausalLM(nn.Module):
# Weight loading config (class-level)
packed_modules_mapping = { ... }
weights_mapping = { ... }
def __init__(self, config: Config, prefix: str = ""):
...
def forward(self, input_ids, positions, intermediate_tensors=None, inputs_embeds=None):
return hidden_states # or logits
def compute_logits(self, hidden_states):
return self.lm_head(hidden_states)
Registration in model_runner.py:
support_model_arch_dict = {
"NewModelForCausalLM": ("new_model", "NewModelForCausalLM"),
}
One model file often serves multiple HuggingFace model_types when their architecture is identical or a strict subset. The mapping lives in atom/model_engine/model_runner.py:support_model_arch_dict — that's the authoritative source. Common patterns:
deepseek_v2.py)._mtp.py companion when the spec-decode head differs from the base model.ColumnParallelLinear: shards output dim, no all-reduce neededRowParallelLinear: shards input dim, all-reduce on output (reduce_results=True)ReplicatedLinear: full copy on each rank (gates, small projections)MoE pattern: FusedMoE + shared_experts both use reduce_results=False, parent does one all-reduce.
atom/models/new_model.py — Model implementationatom/model_engine/model_runner.py — Register in support_model_arch_dictatom/config.py — Add to _CONFIG_REGISTRY if config schema differs.github/benchmark/models_accuracy.json — CI accuracy test entryrecipes/ — Usage recipegrep same pattern across codebase (fix-then-sweep)simple_inference.py smoke testlm_eval for accuracy regressionweight (FP8/FP4 packed) + weight.scale (E8M0 block scale).scale → .weight_scale_inv → .weight_scale (auto-rename in loader)process_weights_after_loading() hook: shuffle weights for CK kernel layoutMxfp4MoEMethod.create_weights() + mxf4_merged_weight_loader()@support_torch_compile decorated models (breaks Dynamo)forward() (has @torch.inference_mode()), NOT in run_model()ATOM_V4_DIAG=1)--level 0 --enforce-eager to disable both torch.compile and CUDAGraphtests/ directory at repo roottorch.cudatest_<module>.py (e.g., test_scheduler.py, test_block_manager.py)python -m atom.examples.simple_inference --model <path> --kv_cache_dtype fp8lm_eval with gsm8k (CI threshold != actual baseline)Authoritative list: atom/utils/envs.py (all ATOM_* defined as lazy lambdas). To read what an env var does, grep the file for its name — the lambda and the call site comment describe the behavior. Required per-model env vars are listed in .github/benchmark/models.json and .github/benchmark/models_accuracy.json.
.github/benchmark/models_accuracy.json (model matrix, thresholds, baselines)..github/benchmark/models.json (server args, bench args, runner pinning)..github/dashboard/index.html (gh-pages)..github/workflows/*.yaml is the source of truth (action versions pinned per workflow).Capture a PyTorch profiler / kineto trace from a running ATOM server for a short benchmark window. Use when the user asks for "a trace", "profiler trace", "GPU trace", or "抓 trace" for performance investigation — what kernels ran, what's on the critical path, what's slow. Do NOT use for crashes (use debug-agent-locate-kernel) or numerical bugs (use dump-bisect-debug).
Run any ATOM workload — accuracy eval (GSM8K via lm_eval), performance benchmark, concurrency sweep, offline simple_inference, or fault repro under rocm-debug-agent. Use when the user asks to "test accuracy", "测精度", "跑 GSM8K", "跑 benchmark", "test performance", "run sweep", "repro the fault", "测一下 MTP1 精度", "跑 simple_inference" — anything that drives an ATOM workload. Encodes the canonical flow (stop → start → workload-in-bg → wait_infer_drain → stop) and the model-family env vars. Same pattern works for both server-based workloads (lm_eval / benchmark client) and offline simple_inference. Do NOT use for profiling traces (use capture-trace).
AI code review for ATOM PRs. ATOM consumes aiter kernels and integrates with vLLM/SGLang plugins. Reviews check perf claims, aiter cross-repo deps, model coverage, dispatch correctness, and AI-generated code patterns. Invoke with a PR number.