Installing the Factory SDK
This guide walks you through the process of installing the Factory SDK.
System Requirements
Before installing, ensure your system meets these requirements:
- Python: Version 3.10 or higher
- Operating System: Linux (x86_64 architectures)
- Hardware:
- GPU: NVIDIA GPU with CUDA support (required)
- Memory: At least 16GB RAM (32GB+ recommended for large-scale fine-tuning)
- Disk Space: At least 10GB free for model weights and datasets
Basic Installation
Install the Factory SDK using pip:
Or if you use Poetry:
This will install the latest available version of the SDK along with its dependencies like transformers, datasets, pydantic, and various ML libraries.
GPU Acceleration Setup
For proper functionality:
- Ensure CUDA Toolkit is installed
- Update your NVIDIA drivers
- The SDK automatically includes acceleration libraries like bitsandbytes, deepspeed, and vllm
Verify your GPU setup with:
This should return True
if your GPU is properly configured.
Troubleshooting
Common Installation Issues
-
Package Conflicts
- Issue: Dependency conflicts with existing packages
- Solution: Use a virtual environment
-
Permission Errors
- Issue: "Permission denied" during installation
- Solutions:
-
Missing Dependencies
- Issue: Installation fails due to missing libraries
- Solution: Ensure you have all build dependencies
-
GPU Not Detected
- Issue:
torch.cuda.is_available()
returns False - Solutions:
- Verify GPU is recognized:
nvidia-smi
- Check CUDA installation:
nvcc --version
- Reinstall CUDA if needed:
sudo apt-get install --reinstall cuda
- Verify GPU is recognized:
- Issue:
-
Version Compatibility
- Issue: Package incompatible with Python version
- Solution: Ensure you're using Python 3.10 or higher
-
Memory Errors During Import
- Issue: Out of memory when loading large models
- Solution: Increase swap space or use a system with more RAM