JORA: JAX Tensor-Parallel LoRA Library for Retrieval Augmented Fine-Tuning

Anique Tahir, Lu Cheng, Huan Liu


Abstract
The scaling of Large Language Models (LLMs) for retrieval-based tasks, particularly in Retrieval Augmented Generation (RAG), faces significant memory constraints, especially when fine-tuning extensive prompt sequences. Current open-source libraries support full-model inference and fine-tuning across multiple GPUs but fall short of accommodating the efficient parameter distribution required for retrieved context. Addressing this gap, we introduce a novel framework for PEFT-compatible fine-tuning of GPT models, leveraging distributed training. Our framework uniquely utilizes JAX’s just-in-time (JIT) compilation and tensor-sharding for efficient resource management, thereby enabling accelerated fine-tuning with reduced memory requirements. This advancement significantly improves the scalability and feasibility of fine-tuning LLMs for complex RAG applications, even on systems with limited GPU resources. Our experiments show more than 12x improvement in runtime compared to Hugging Face/DeepSpeed implementation with four GPUs while consuming less than half the VRAM per GPU.
Anthology ID:
2024.acl-demos.15
Volume:
Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations)
Month:
August
Year:
2024
Address:
Bangkok, Thailand
Editors:
Yixin Cao, Yang Feng, Deyi Xiong
Venue:
ACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
152–159
Language:
URL:
https://aclanthology.org/2024.acl-demos.15
DOI:
Bibkey:
Cite (ACL):
Anique Tahir, Lu Cheng, and Huan Liu. 2024. JORA: JAX Tensor-Parallel LoRA Library for Retrieval Augmented Fine-Tuning. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations), pages 152–159, Bangkok, Thailand. Association for Computational Linguistics.
Cite (Informal):
JORA: JAX Tensor-Parallel LoRA Library for Retrieval Augmented Fine-Tuning (Tahir et al., ACL 2024)
Copy Citation:
PDF:
https://aclanthology.org/2024.acl-demos.15.pdf