TL;DR
This paper introduces HPC-GPT, a novel Large Language Model (LLM) specifically fine-tuned for High-Performance Computing (HPC) tasks. By leveraging an automated data collection pipeline and fine-tuning on domain-specific instruction data, HPC-GPT demonstrates competitive performance on tasks like AI model/dataset management and data race detection, bridging the gap between general LLMs and specialized HPC needs.
What Problem Does This Paper Address?
Large Language Models (LLMs) have shown remarkable capabilities in general natural language processing tasks. However, their application to specialized domains like High-Performance Computing (HPC) has been suboptimal. This is primarily due to the lack of domain-specific knowledge and the specialized expertise required to interpret their outputs for HPC-related challenges. Existing LLMs, even advanced ones like ChatGPT, struggle with accurate answers for HPC-specific queries. While some attempts have been made to adapt LLMs for HPC, they often rely on existing general LLMs or require significant manual effort for data curation and instruction generation. This paper aims to address this gap by developing an LLM tailored for HPC, capable of understanding and performing tasks within this domain more effectively.
Methods
The core of this work is the HPC-GPT model, built upon the open-source LLaMA base model. The development process involves four key stages:
- Automatic Data Collection with LLM: This novel pipeline uses GPT-4 to automatically generate domain-specific instruction data for HPC tasks. It takes unstructured and structured HPC data as input and, guided by specific prompts and requirements, generates question-answer pairs. This process is designed to be more efficient than manual data creation.
- Training Pipeline: This involves two steps:
- Pretraining: Utilizing the open-source LLaMA and LLaMA2 models as base models, chosen for their performance and open availability.
- Supervised Fine-tuning (SFT): The pre-trained models are then fine-tuned using the automatically generated HPC-specific instruction data. Techniques like LoRA (low-rank adaptation) and PEFT (parameter-efficient fine-tuning) are employed to optimize the training process and reduce computational costs.
- Evaluation: The fine-tuned HPC-GPT model is rigorously evaluated on specific HPC tasks using established benchmarks.
- Deployment with Web GUI: The trained model is made accessible via a web server and API for use by HPC scientists and researchers.
A crucial aspect of the data collection is the filtering and pruning step, which removes instruction data that violates predefined rules or formatting requirements, ensuring data quality.
Datasets
The paper introduces two new open-source datasets for the HPC domain:
- HPC Models and Datasets: This dataset is designed for the task of managing AI models and datasets for programming language processing (PLP) and MLPerf tasks. It contains information categorized into 13 PLP subtasks (e.g., code repair, clone detection) and 5 MLPerf categories (e.g., system, processor).
- Data Race Detection Dataset: This dataset is for evaluating data race detection capabilities. It includes code snippets with and without data races, categorized into common data race types for C/C++ and Fortran.
The paper also mentions using existing benchmarks like DataRaceBench V1.4.0 for evaluating data race detection.
Key Insights and Ideas
- Automated Instruction Generation is Key: The paper highlights the significant challenge of creating high-quality, domain-specific instruction data for LLMs. Their automated pipeline using GPT-4 offers a promising solution to overcome this bottleneck, making LLM fine-tuning for specialized domains more feasible.
- LLMs Can Bridge the HPC Knowledge Gap: HPC-GPT demonstrates that with proper fine-tuning on domain-specific data, LLMs can achieve competitive performance on complex HPC tasks, moving beyond their general-purpose capabilities.
- Domain-Specific LLMs Outperform General Ones: The results show that HPC-GPT (both L1 and L2 versions) significantly outperforms general LLMs like GPT-3.5, GPT-4, LLaMA, and LLaMA2 on HPC-specific tasks, underscoring the importance of domain adaptation.
- LLMs Offer a More Accessible Alternative: While tools like HPC Ontology can provide accurate answers, they often require manual query formulation. HPC-GPT, by translating natural language queries into relevant actions, offers a more user-friendly and scalable approach.
Key Results
- AI Model/Dataset Management: HPC-GPT successfully retrieves and extracts relevant HPC-related datasets and models based on natural language queries, handling multiple conditions effectively. It outperforms GPT-4 in providing specific answers for tasks like code translation and MLPerf system identification.
- Data Race Detection:
- In C/C++ tasks, HPC-GPT (L2) achieved an accuracy of 0.8037 and an Adjusted F1 score of 0.8072, ranking second among LLM-based methods and showing significant improvements over LLaMa, LLaMa2, GPT-3.5, and GPT-4.
- In Fortran tasks, HPC-GPT (L2) achieved an Adjusted F1 score of 0.8333, demonstrating strong performance and improvements over other LLMs.
- While traditional tools like Thread Sanitizer still lead in some metrics, HPC-GPT shows a substantial leap in performance for LLM-based approaches in this domain.
Limitations and Future Work
- Token Length Limitation: A significant limitation for LLM-based data race detection is the 8k token constraint, which prevents them from analyzing very large code snippets. The authors suggest exploring methods to extend token limits or develop pre-processing/partitioning mechanisms.
- Updating HPC-GPT: The continuous release of new datasets and models in HPC presents a challenge for keeping HPC-GPT up-to-date. The paper suggests periodic retraining, checkpointing, or leveraging frameworks like LangChain for seamless integration of new data.
- Further Evaluation: While the paper demonstrates strong performance on two key HPC tasks, further evaluation across a wider range of HPC applications is suggested to fully explore the potential of HPC-GPT.
Summary updated