一键导入
dftracer-memory-optimization
Memory-component bottleneck-to-optimization mappings, papers, and L1/L2/L3 strategies for the dftracer optimization pipeline
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Memory-component bottleneck-to-optimization mappings, papers, and L1/L2/L3 strategies for the dftracer optimization pipeline
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Communication-component (MPI/collective/network) bottleneck-to-optimization mappings, papers, and L1/L2/L3 strategies for the dftracer optimization pipeline
Compute-component bottleneck-to-optimization mappings, papers, and L1/L2/L3 strategies for the dftracer optimization pipeline
Key literature, bottleneck-to-optimization mappings, and strategies for the dftracer I/O optimization pipeline
VPIC-Kokkos-specific knowledge: build/annotation quirks, the two-stage deck-compile pattern, deck sizing for smoke vs validation runs, and the measured MPI-communication-bound diagnosis on Tuolumne. Load this skill whenever working with vpic-kokkos (github.com/lanl/vpic-kokkos).
Install and build dftracer into the session using the MCP install tool and record tool pitfalls early.
Diagnose traces and convert symptoms into actionable bottlenecks with MCP tools.
| name | dftracer-memory-optimization |
| description | Memory-component bottleneck-to-optimization mappings, papers, and L1/L2/L3 strategies for the dftracer optimization pipeline |
Cross-references: [[dftracer-io-optimization]] [[dftracer-compute-optimization]] [[dftracer-communication-optimization]] [[dftracer-optimization-kb]]
Memory-component sibling of dftracer-io-optimization. The metric key used by the MCP
optimization tools is mem_bw (see _L1_STRATEGIES/_L2_STRATEGIES/_L3_STRATEGIES["mem_bw"]
in mcp_tools/tools/optimizations/strategies.py); related classification keys: memory,
cache_miss, numa.
Every row in the resulting opt_proposal_table MUST carry app_impact_pct (% of current application wall time, measured or bounded-estimate) and system_impact_pct (throughput/bandwidth/utilization effect, 0 if not measured/applicable) — columns: #, Strategy, Description of Optimization, App Impact, System Impact, Weighted Score (50/50 weighted, auto-sorted descending by the tool). Never omit these fields.
malloc+memcpy where the app's logic permits it losslessly).LD_PRELOAD, tuned arena count.cudaMallocHost/hipHostMalloc-backed
pinned buffers so DMA transfers don't need an extra staging copy — only pays off when
combined with correct core/GPU-die affinity (see the compute skill; measure both together
as separate line items, never bundle their attribution).madvise(MADV_HUGEPAGE) for large allocations to cut TLB miss rate.numactl --cpunodebind=<n> --membind=<n> or hwloc-bind, so
a process's memory lives on the same NUMA node as its compute (shared dimension with the
compute skill — record once, cross-reference).vm.dirty_ratio, vm.vfs_cache_pressure, huge-page
kernel settings — check tunability (often admin-only) before proposing.Per category: run the literature search before marking "not applicable." Never silently omit a category.
Do not propose reducing batch size, dropping cached data the app's correctness depends on, or truncating precision as a memory "optimization" — that changes what the app computes/holds, not how efficiently the system serves the SAME memory access pattern. Buffer pooling, in-place ops, and cache blocking are safe ONLY when the app's logical data lifetime and values are unchanged; verify with a correctness check (byte-identical output) before crediting a result.
madvise — back large allocations with huge pages to cut TLB
miss rate (MALLOC_MMAP_THRESHOLD_, MALLOC_TRIM_THRESHOLD_).LD_PRELOAD=libjemalloc.so with MALLOC_CONF=narenas:<numa_nodes>
to keep per-thread arenas NUMA-local.numactl --cpunodebind=<n> --membind=<n> (see strategies.py L3
mem_bw entry).vm.vfs_cache_pressure, vm.dirty_ratio — admin-only on most HPC
systems, verify tunability first.| Metric | Optimization goal |
|---|---|
mem_bw / memory / cache_miss / numa | Reduce memory-bound stall time / increase effective bandwidth utilization without changing what data the app holds or when |
Memory is optimized THIRD in the canonical I/O -> communication -> memory -> compute order — after I/O and communication, since memory-bound stalls are often masked by (or masking) those larger-magnitude bottlenecks, but before compute tuning (a compute-bound kernel gains nothing from memory tuning; verify with roofline first).