Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
winglian committed Feb 1, 2024
1 parent b76ec9f commit fce6ea7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/axolotl/utils/samplers/multipack.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,11 @@ def generate_batches(self, set_stats=False):
)

batches = [
[[indices[b_idx] for b_idx in batch] for _ in range(self.batch_size)]
for batch in batches
[
[indices[b_idx] for b_idx in batch]
for batch in batches[i : i + self.batch_size]
]
for i in range(0, len(batches), self.batch_size)
]

# statistics
Expand Down Expand Up @@ -192,7 +195,7 @@ def _len_est(self):
0.99
* lengths_sum_per_device
/ self.packing_efficiency_estimate
// self.batch_max_len
// (self.batch_max_len * self.batch_size)
)
- 1
),
Expand Down
2 changes: 1 addition & 1 deletion src/axolotl/utils/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def calculate_total_num_steps(cfg, train_dataset, update=True):
train_dataset.remove_columns(["length"]),
batch_sampler=sampler,
)
data_loader_len = len(data_loader)
data_loader_len = len(data_loader) // batch_size
actual_eff = sampler.efficiency()
LOG.debug(f"data_loader_len: {data_loader_len}", main_process_only=True)
# FIXME: is there a bug here somewhere? the total num steps depends
Expand Down

0 comments on commit fce6ea7

Please sign in to comment.