用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ZhangXin8069/20250814-20260815 --skill run-pipeline-gpu命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | run-pipeline-gpu |
| description | 运行 docker-v20260727 GPU 加速验证管线 — OPE 从头计算,所有中间结果/日志/图表保存,使用 CUDA/CuPy |
在当前环境直接运行完整的 disconnected 胶子 PDF 验证管线,使用 GPU 加速 (CUDA/CuPy)。
核心特征:
系综: beta6.20_mu-0.2770_ms-0.2400_L24x72 (L24x72)
格点: 72×24³, a=0.1053 fm, β=6.20
Nev: 100 (eigvec cfg_48000 复用)
组态: 6250, 6450, 6650 (Nconf=3)
动量: P=(0, 0, -2), mom_smear=-2
算符: _Cg5g4 (Cγ₅γ₄)
GPU: CUDA/CuPy, 自动检测设备
| 数据 | 路径 |
|---|---|
| Eigenvectors | /public/group/lqcd/sunpeng/eigen_vector/beta6.20_mu-0.2770_ms-0.2400_L24x72_cfg_48000.eigenvector.npy |
| Eigenvalues | /public/group/lqcd/sunpeng/eigen_vector/beta6.20_mu-0.2770_ms-0.2400_L24x72_cfg_48000.eigenvalue.npy |
| Perambulators | /public/group/lqcd/sunpeng/mom_smear_perambulators/beta6.20_mu-0.2770_ms-0.2400_L24x72/output_dir_data/mz2_my0_mx0/{conf_id}/ |
| Gauge configs | /public/group/lqcd/configurations/CLOVER/beta6.20_mu-0.2770_ms-0.2400_L24x72/beta6.20_mu-0.2770_ms-0.2400_L24x72_cfg_{conf_id}.lime |
| OPE | 从头计算:gauge config → Clover plaquette → F_{μν} → Wilson 线 → 非定域 OPE → .npz |
| 步骤 | 描述 | GPU 加速 | 保存内容 |
|---|---|---|---|
| 0 | 环境检查 | GPU 设备检测 | Python 模块、CUDA/CuPy、数据路径 |
| 1 | 质子 2pt 蒸馏 | VVV 重子块 GPU, Wick 收缩 GPU | VVV 块、原始 Wick 收缩、宇称投影、有效质量 |
| 2 | OPE 从头计算 | F_{μν} GPU, Wilson 线 GPU, OPE GPU | F_{μν} 场强张量、Gauge 验证诊断、OPE 算符 |
| 3 | huangcl 比率分析 | Jackknife GPU 加速 | 比率 R(z)、诊断图、有效质量图、场强诊断图 |
| 4 | 最终报告 | — | Markdown 综合报告 |
| 数据 | 大小 | 策略 |
|---|---|---|
| Eigenvectors | 4.5 GB | CPU 驻留,按时间片传输到 GPU |
| Gauge configs | 72 MB | 整体加载到 GPU |
| VVV 输出 | 1.1 GB | GPU 计算后立即保存到 CPU |
| F_{μν} 张量 | ~72 MB | GPU 计算,保存到 CPU |
| Wick 收缩 | ~40 MB | GPU 计算,结果传回 CPU |
output_YYYYMMDD_HHMMSS/
├── run.log # 主日志 (全部 stdout/stderr, 含详细耗时)
├── run_config.json # 运行时配置快照
├── run_config_snapshot.json # 配置快照
├── gpu_info.json # GPU 设备信息快照
├── final_report.md # Markdown 报告
├── timing.jsonl # 每步耗时与内存记录 (含 GPU 内存)
├── data/
│ ├── eigenvalues_Nev100.npy # 特征值 (中间结果)
│ ├── conf_{id}/
│ │ ├── gauge_validation_conf{id}.json # Gauge 验证诊断
│ │ ├── Fmunu_mu{n}_nu{n}.npz # 场强张量 (GPU 计算, 中间结果)
│ │ ├── ops_mu{n}_nu{n}_dz{delta_z}_conf{id}.npz # OPE 算符
│ │ ├── VVV_Nev1{n}_Px{n}Py{n}Pz{n}_conf{id}.npy # VVV 重子块 (GPU 计算)
│ │ ├── twopt_slice_pp_*_contract_*.npy # 原始 Wick 收缩
│ │ ├── twopt_slice_pp_*_nopol_ss_*.npy # 质子 2pt (PP)
│ │ ├── twopt_slice_pm_*_nopol_ss_*.npy # 质子 2pt (PM)
│ │ ├── meff_Pz{n}_conf{id}.npz # 有效质量
│ │ ├── compute_2pt_summary.json # 2pt 计算摘要
│ │ └── compute_ope_summary_conf{id}.json # OPE 计算摘要
│ ├── ...
└── plots/
├── ratio.png # R(z) 比率
├── ratio_diagnostics.png # 多 z 值 Re/Im 诊断
├── effective_mass.png # 有效质量 + 平台拟合
├── field_strength_diagnostics.png # OPE 场强质量诊断
├── ratio_results.npz # 数值结果
├── ope_combined.npz # 组合 OPE
├── correlators_rel_time.npz # 相对时间关联函数
└── analysis_summary.json # 分析摘要
run-pipeline-gpu run — 运行完整 GPU 加速管线cd /root/lattice-pdf/agent/docker-v20260727
# 完整运行 (3 组态, GPU 加速)
python run_pipeline.py
# 单组态快速测试
python run_pipeline.py --conf-id 6250
# 跳过某些步骤
python run_pipeline.py --skip-2pt --skip-ope
# 仅计算不分析
python run_pipeline.py --skip-analysis --skip-report
# 自定义输出目录
python run_pipeline.py --output-dir /path/to/output
# 详细调试模式
python run_pipeline.py --verbose
run-pipeline-gpu status — 查看最新运行状态latest=$(ls -dt /root/lattice-pdf/agent/docker-v20260727/output_*/ 2>/dev/null | head -1)
[ -n "$latest" ] && echo "=== $latest ===" && tail -50 "$latest/run.log"
run-pipeline-gpu check — GPU 环境检查cd /root/lattice-pdf/agent/docker-v20260727 && python3 -c "
import sys, os, cupy as cp
print(f'Python: {sys.version}')
print(f'CuPy: {cp.__version__}')
print(f'CUDA: {cp.cuda.runtime.runtimeGetVersion()}')
d = cp.cuda.Device()
print(f'Device: {d}')
mem = d.mem_info
print(f'GPU Memory: {mem[0]/1024**3:.1f} GB free / {mem[1]/1024**3:.1f} GB total')
for mod in ['numpy', 'scipy', 'matplotlib', 'opt_einsum']:
try:
m = __import__(mod)
print(f' ✓ {mod}: {getattr(m, \"__version__\", \"?\")}')
except ImportError:
print(f' ✗ {mod}: MISSING')
"
run-pipeline-gpu module <module> — 单独运行某模块cd /root/lattice-pdf/agent/docker-v20260727
# 仅计算 2pt (GPU)
python compute_2pt_gpu.py --run-dir ./output_test
# 仅计算 OPE (GPU)
python compute_ope_gpu.py --run-dir ./output_test --conf-id 6250
# 仅运行分析
python analyze_ratio.py --run-dir ./output_test --data-dir ./output_test/data --output-dir ./output_test/plots
| 变更 | v20260726 | v20260727 |
|---|---|---|
| VVV 计算 | NumPy einsum (CPU) | CuPy 2-step einsum (GPU) |
| Wick 收缩 | NumPy einsum (CPU) | CuPy step-by-step einsum (GPU) |
| F_{μν} 场强 | snsc plaquette_clover (CPU/CuPy) | 独立 GPU 实现 |
| Wilson 线 | NumPy 逐点循环 (CPU) | GPU 累积输运子 (批量einsum) |
| OPE 缩并 | NumPy einsum (CPU) | CuPy einsum (GPU) |
| Gamma 矩阵 | NumPy | CuPy |
| 精度 | complex128 (双) | complex64 (单, 默认), 可选 complex128 |
| GPU 内存追踪 | 无 | GPU 空闲/峰值内存 |
| 步骤 | 时间 (Nconf=1) | 时间 (Nconf=3) | 备注 |
|---|---|---|---|
| 环境检查 | <1s | <1s | |
| 2pt: VVV | 26s | 26s (缓存复用) | 0.37s/时间片, GPU |
| 2pt: Wick | 109s | 330s | 49ms/pair, GPU |
| OPE: Gauge读取 | 38s | 114s | ILDG .lime 头部扫描 |
| OPE: F_{μν} | 0.3s/分量 | 0.3s/分量 | Clover plaquette, GPU |
| OPE: Wilson累积 | 0.02s/分量 | 0.02s/分量 | 批量累积输运子, GPU |
| OPE: 缩并 | 2s/分量 | 2s/分量 | 24个z值, GPU |
| 分析 | 3s | 3s | Jackknife + 4张图 |
| 总计 | 198s (3.3min) | 508s (8.5min) |
einsum("x,ax,bx,cx->abc") → einsum("x,ax,bx->abx")·einsum("abx,cx->abc"),中间张量从4.6GB降至46MB,40x加速