arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.01651cs.LGcs.AI
收藏

微调 LLaMA 2 推理:面向最优效率的语言实现比较研究

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(索纳冈大学)

Sazzad Hossain, Touhidul Alam Seyam, Avijit Chowdhury, Munis Xamidov, Rajib Ghose, Abhijit Pathak

AI总结:

本文通过基准测试比较多种语言和框架在 Llama2 推理中的表现,重点验证 Mojo SDK 在 Apple Silicon 上的性能、易用性与 Python 兼容性,为资源受限硬件上的 LLM 部署提供优化依据。

摘要:

本文提出了一项旨在优化 Llama2 推理的比较研究,Llama2 推理是机器学习和自然语言处理(NLP)的一个关键方面。我们评估了多种编程语言和框架,包括 TensorFlow、PyTorch、Python、Mojo、C++ 和 Java,并通过广泛的基准测试分析它们在速度、内存消耗和实现易用性方面的表现。文中突出了每种方法的优势与局限,并提出了针对并行处理和硬件利用的优化策略。此外,我们研究了 Mojo SDK,这是一个专为 Apple Silicon 上的大语言模型(LLM)推理而设计的新型框架,并将其性能与 C、C++、Rust、Zig、Go 和 Julia 的实现进行了基准对比。我们在 Apple M1 Max 上进行的实验表明,Mojo SDK 具有有竞争力的性能、易用性以及无缝的 Python 兼容性,使其成为在 Apple Silicon 上进行 LLM 推理的有力替代方案。我们还讨论了在资源受限硬件上部署 LLM 的更广泛影响,并指出了未来研究的潜在方向。

英文摘要:

This paper presents a comparative study aimed at optimizing Llama2 inference, a critical aspect of machine learning and natural language processing (NLP). We evaluate various programming languages and frameworks, including TensorFlow, PyTorch, Python, Mojo, C++, and Java, analyzing their performance in terms of speed, memory consumption, and ease of implementation through extensive benchmarking. Strengths and limitations of each approach are highlighted, along with proposed optimization strategies for parallel processing and hardware utilization. Furthermore, we investigate the Mojo SDK, a novel framework designed for large language model (LLM) inference on Apple Silicon, benchmarking its performance against implementations in C, C++, Rust, Zig, Go, and Julia. Our experiments, conducted on an Apple M1 Max, demonstrate Mojo SDK's competitive performance, ease of use, and seamless Python compatibility, positioning it as a strong alternative for LLM inference on Apple Silicon. We also discuss broader implications for LLM deployment on resource-constrained hardware and identify potential directions for future research.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑