To estimate the number of V100 32GB GPUs needed to train a 70B parameter model using the QLORA method with 4-bit NormalFloat (nf4) and a 100K context window, we need to consider several factors: model size, memory requirements, and the number of GPUs that can be used efficiently for training.
- Model size: A 70B parameter model would have around 70 billion weights when using 4-bit NormalFloat (nf4). This is a rough estimate, as the actual size depends on the model architecture and its parameters.
- Memory requirements: QLORA training requires additional memory for the quantum states, which are sampled from a 256-dimensional space. The memory requirements for the quantum states are 256 times the memory required for the model's weights. So, the total memory requirement for training the model would be:
Total memory requirement = 70 billion * (4 bits/weight + 8 bits/quantum state)
This results in approximately 70 billion * (4 + 8) / 4 = 70 billion * 12 / 4 = 175 billion bits or 22.0875 billion bytes.
- Number of GPUs: The number of GPUs that can efficiently train a model with QLORA depends on the batch size and the number of parallel chains used for the method. It is recommended to use large batch sizes (e.g., 128 or 256) and a moderate number of parallel chains (e.g., 8 to 16) for better parallelism and mixing of the chains.
Assuming you use a batch size of 128 and 16 parallel chains, the memory requirement per GPU would be:
Memory per GPU = 175 billion bytes / (128 * 16) = 175 billion bytes / 2048 ≈ 857.63 million bytes
The V100 32GB GPU has a total memory capacity of approximately 32 GB or 32 * 10^9 bytes.
To determine the number of V100 32GB GPUs needed, divide the memory per GPU by the memory capacity of a single GPU:
Number of GPUs = Memory per GPU / Memory per GPU = 857.63 million bytes / 32 * 10^9 bytes ≈ 0.0267
This result suggests that you would need approximately 26.7 GPUs to train the 70B model using the QLORA method with 4-bit NormalFloat (nf4) and a 100K context window. However, this is a rough estimate, and the actual number of GPUs might differ depending on various factors, such as the model architecture and batch size. It's recommended to experiment with different configurations to find the most efficient setup for your specific use case.