我们提出了Metal-Sci,一个包含10个科学任务的苹果硅芯片Metal计算内核基准,涵盖六个优化领域(如Stencil、n-body问题、多场Boltzmann、邻接列表分子动力学、多内核PDE、FFT)。每个任务提供CPU参考、基于roofline的适应度函数和保留的泛化规模。我们配对了一个轻量级的Harness用于自动内核搜索,该Harness在运行时编译每个候选内核,将其在多个规模上与roofline进行评分,并将结构化的编译和每种规模的正确性诊断反馈给一个固定的LLM,驱动一个(1+1)进化循环。我们报告了在M1 Pro上Claude Opus 4.7、Gemini 3.1 Pro和GPT 5.5的匹配单模型扫描:在分布内的自我加速范围为1.00×到10.7×。除了原始加速外,我们的核心方法论主张是结构化的:保留的门评分函数Φ_T(在运行结束时在代理从未见过的配置上评估一次)作为该自动搜索循环的廉价机械监督原语,例如捕捉到Opus模板<uint D> HMC胜利在未见维度上返回错误样本,以及GPT FFT3D最佳在分布内以2.95×的加速胜出,但在256^3保留的立方体上崩溃到0.23×,这是一个无法被分布内评分单独看到的沉默回归。代码在https://github.com/vicgalle/metal-sci-kernels。
英文摘要:
We present Metal-Sci, a 10-task benchmark of scientific Apple Silicon Metal compute kernels spanning six optimization regimes (stencils, all-pairs in $n$-body problems, multi-field Boltzmann, neighbor-list molecular dynamics, multi-kernel PDE, FFT). Each task ships a CPU reference, a roofline-anchored fitness function, and a held-out generalization size. We pair the benchmark with a lightweight harness for automatic kernel search that runtime-compiles each candidate, scores it against the roofline across multiple sizes, and feeds structured compile and per-size correctness diagnostics back to a frozen LLM driving a $(1{+}1)$ evolutionary loop. We report matched single-model sweeps of Claude Opus 4.7, Gemini 3.1 Pro, and GPT 5.5 on M1 Pro: in-distribution self-speedups span $1.00\times$ to $10.7\times$. Beyond raw speedup, our central methodological claim is structural: the held-out gate scoring function $Φ_\mathcal{T}$ (evaluated once at end-of-run on a configuration the agent never sees during search) functions as a cheap mechanical oversight primitive on this automatic search loop, catching e.g. an Opus template <uint D> HMC win that returns wrong samples at unseen dimensions, and a GPT FFT3D best that wins in-distribution at $2.95\times$ speedup but collapses to $0.23\times$ on a $256^3$ held-out cube, a silent regression that the in-distribution score alone cannot see. Code at https://github.com/vicgalle/metal-sci-kernels
Fine-tuning LLaMA 2 interference: a comparative study of language implementations for optimal efficiency
Synergy University(协同大学);BGC Trust University(BGC信托大学);Chittagong University of Engineering and Technology(吉大港工程技术大学);Samarkand State University(撒马尔罕国立大学);Military Institute of Science and Technology (MIST)(科技军事学院);Sonargaon University(索纳冈大学)