blt/bytelatent
Pedro Rodriguez 203bff3696
Some checks are pending
Lint with Black / lint (push) Waiting to run
Lint with isort / lint (push) Waiting to run
Pass mask in packing_iterator, correctly handle last batch, fix masking
This commit does/fixes the following:

1. Adds unit tests for byte and patch packing to ensure it works correctly
2. Fixes a bug where for batches that end up with <max_length number of bytes (e.g., short patches), the mask was including elements that had value pad_id. This fixes the mask by setting it to be !=pad_id, if its not specified.
3. Correctly handles the last batch, where previously it would crash. This didn't affect training since we had enough data and/or looped iterators, but for evaluation perplexity, it comes up if we validation on an entire file.
4. Correctly forward the mask if it exists for byte packing

Test Plan:

```
pytest bytelatent/
```

Testing these changes more thoroughly in a stacked PR that fixes evals
2025-02-22 01:27:13 +00:00
..
configs Remove byte tokenizer and add config args to switch between byte/patch packing 2025-02-22 01:13:13 +00:00
data Pass mask in packing_iterator, correctly handle last batch, fix masking 2025-02-22 01:27:13 +00:00
model Make apex logs less noisy (#60) 2025-02-18 10:45:56 -08:00
plotting Add plotting code from paper (#17) 2025-01-09 12:11:50 -08:00
preprocess Allow ArrowIterator to read from json (#45) 2025-02-06 09:57:22 -08:00
tokenizers Remove byte tokenizer and add config args to switch between byte/patch packing 2025-02-22 01:13:13 +00:00
.DS_Store Initial commit 2024-12-12 15:32:30 -08:00
__init__.py Initial commit 2024-12-12 15:32:30 -08:00
args.py Remove byte tokenizer and add config args to switch between byte/patch packing 2025-02-22 01:13:13 +00:00
base_transformer.py Make apex logs less noisy (#60) 2025-02-18 10:45:56 -08:00
checkpoint.py Update checkpointing to use fsspec (#39) 2025-02-06 09:41:58 -08:00
config_parser.py Make it possible to specify multiple config files (#54) 2025-02-18 10:42:44 -08:00
constants.py Initial commit 2024-12-12 15:32:30 -08:00
distributed.py Add bpb and n_bytes to metric logging (#41) 2025-02-07 13:14:30 -08:00
entropy_model.py Changes for training entropy model and correcting attention in local models (#25) 2025-01-17 14:23:01 -08:00
eval.py Make it possible to specify multiple config files (#54) 2025-02-18 10:42:44 -08:00
float8.py Initial commit 2024-12-12 15:32:30 -08:00
generate.py This includes fixes that make checkpointing and reloading work correctly. (#35) 2025-01-27 16:56:42 -08:00
logger.py Update checkpointing to use fsspec (#39) 2025-02-06 09:41:58 -08:00
metrics.py Add bpb and n_bytes to metric logging (#41) 2025-02-07 13:14:30 -08:00
norms.py Fix distributed all reduce grad norm (#40) 2025-02-04 16:53:50 -08:00
optim.py Initial commit 2024-12-12 15:32:30 -08:00
print_config.py Make it possible to specify multiple config files (#54) 2025-02-18 10:42:44 -08:00
probe.py Initial commit 2024-12-12 15:32:30 -08:00
profiling.py Initial commit 2024-12-12 15:32:30 -08:00
stool.py Allow ArrowIterator to read from json (#45) 2025-02-06 09:57:22 -08:00
test_blt.py Initial codes and scripts for training entropy model (#34) 2025-01-27 09:46:44 -08:00
test_config_parser.py Make it possible to specify multiple config files (#54) 2025-02-18 10:42:44 -08:00
test_entropy_model.py Test first batch matches (#53) 2025-02-13 10:05:08 -08:00
train.py Make it possible to specify multiple config files (#54) 2025-02-18 10:42:44 -08:00
transformer.py Make apex logs less noisy (#60) 2025-02-18 10:45:56 -08:00