lightning-transformers  by Lightning-Universe

Archived library for training Transformers with PyTorch Lightning

Created 4 years ago
612 stars

Top 53.6% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides flexible components for integrating Hugging Face Transformers with PyTorch Lightning, targeting researchers and engineers who want to leverage PyTorch Lightning's scaling capabilities for Transformer models. It simplifies the setup and training of various NLP tasks by offering pre-built LightningModule and LightningDataModule abstractions.

How It Works

The library abstracts common NLP tasks (like text classification and translation) into reusable LightningModule classes. These modules encapsulate the Hugging Face model and tokenizer, along with task-specific logic. LightningDataModule classes handle dataset loading, preprocessing, and batching, ensuring compatibility with the PyTorch Lightning Trainer. This approach reduces boilerplate code and allows users to focus on model experimentation and scaling.

Quick Start & Requirements

  • Install via pip: pip install lightning-transformers
  • Requires PyTorch Lightning and Hugging Face Transformers.
  • Supports large models (e.g., 6B parameters) with DeepSpeed integration for distributed training and accelerate for efficient inference.
  • Documentation: https://lightning-transformers.readthedocs.io/en/latest/

Highlighted Details

  • Simplifies training of Hugging Face Transformers with PyTorch Lightning.
  • Offers pre-built modules for common NLP tasks and datasets.
  • Supports large model inference and training using accelerate and DeepSpeed.
  • Provides examples for text classification, translation, and language modeling.

Maintenance & Community

  • The repository has been archived as of November 21, 2022.
  • The maintainers suggest that direct integration with PyTorch Lightning's Trainer is now sufficient.
  • Community support is available via Slack.

Licensing & Compatibility

  • The repository does not explicitly state a license in the README. However, the parent organization's typical licensing is Apache 2.0.
  • Compatibility for commercial use is likely, assuming an Apache 2.0 license.

Limitations & Caveats

This repository is archived and no longer actively maintained. The developers recommend using PyTorch Lightning's native integration with Hugging Face Transformers, as the abstractions provided by this library are no longer deemed necessary or are not being supported.

Health Check
Last Commit

2 years ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
2 stars in the last 30 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), and
5 more.

matmulfreellm by ridgerchu

0.0%
3k
MatMul-free language models
Created 1 year ago
Updated 1 month ago
Feedback? Help us improve.