mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
Readability and code quality improvements (#959)
* Consistent dataset naming * consistent section headers
This commit is contained in:
committed by
GitHub
parent
7b1f740f74
commit
be5e2a3331
@@ -8,7 +8,7 @@
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
# Import from ./memory_estimator.py
|
||||
from memory_estimator_gqa import kv_bytes_total, DTYPE_BYTES
|
||||
from memory_estimator_gqa import calc_kv_bytes_total, DTYPE_BYTES
|
||||
|
||||
|
||||
def bytes_convert(n):
|
||||
@@ -36,7 +36,7 @@ def plot_abs_kv_vs_context_multi_groups():
|
||||
|
||||
mha_gb = []
|
||||
for L in context_lengths:
|
||||
total_mha = kv_bytes_total(
|
||||
total_mha = calc_kv_bytes_total(
|
||||
batch_size, L, emb_dim, n_heads,
|
||||
n_heads, # MHA: n_kv_heads = n_heads
|
||||
n_layers, bytes_per_elem
|
||||
@@ -52,7 +52,7 @@ def plot_abs_kv_vs_context_multi_groups():
|
||||
n_kv_heads = n_heads // g
|
||||
gqa_gb = []
|
||||
for L in context_lengths:
|
||||
total_gqa = kv_bytes_total(
|
||||
total_gqa = calc_kv_bytes_total(
|
||||
batch_size, L, emb_dim, n_heads,
|
||||
n_kv_heads, n_layers, bytes_per_elem
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user