Commit graph

23 commits

Author SHA1 Message Date
Pedro Rodriguez
96d51b59d2
Open source weights! ()
Summary:

Add code to download weights and demo code for running model.

Weights at:
- https://huggingface.co/collections/facebook/blt-6801263d4ac1704702a192a6
- https://huggingface.co/facebook/blt
- https://huggingface.co/facebook/blt-1b
- https://huggingface.co/facebook/blt-7b

Test Plan:
2025-04-17 09:38:56 -07:00
Srinivasan Iyer
e299427ae4
Cast int sample id to str ()
Co-authored-by: Srini Iyer <sviyer@meta.com>
2025-04-08 17:45:45 -07:00
Pedro Rodriguez
b79eb3ef11
Get generation working for BLT ()
Summary:

Create a script for simple generation from BLT

Test Plan:

```
python -m bytelatent.generate_blt config=../internal-blt/configs/eval_blt.yaml
```
2025-04-01 16:07:55 -07:00
Srinivasan Iyer
fc946a1918
Some fixes for entropy model predictions ()
Co-authored-by: Srini Iyer <sviyer@meta.com>
2025-03-13 10:28:42 -07:00
Pedro Rodriguez
083656ce55
Update ppl evals to work with blt model, in addition to entropy model ()
Summary:

Test Plan:

Run
```
python -m bytelatent.eval config=../internal-blt/configs/eval_blt.yaml validation.max_n_docs=null
python -m bytelatent.eval config=../internal-blt/configs/eval_entropy.yaml validation.max_n_docs=null
```
2025-03-13 10:23:31 -07:00
Pedro Rodriguez
63913e4dba
Reduce per file resources arrow uses ()
Summary:

Test Plan:
2025-03-05 15:03:42 -08:00
Pedro Rodriguez
8f2cf8899d
Let process start before yielding preloaded prefetch buffer, avoid needlessly losing buffer in edge cases ()
Summary:

Test Plan:
2025-03-05 15:02:57 -08:00
Pedro Rodriguez
ea1fc75862
Add approximate state persistence ()
Summary:

Test Plan:

***
More verbose multiprocess logging, fix get_state_and_recycle

Summary:

Test Plan:
2025-03-05 15:01:45 -08:00
Pedro Rodriguez
c727844e9d
Correctly reset batch iterator at each arrow create_iter call. ()
Summary:

Test Plan:
2025-03-03 16:59:02 -08:00
Pedro Rodriguez
08b8c7cd05
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-27 11:41:47 -08:00
Pedro Rodriguez
aeb95f12a1
Remove byte tokenizer and add config args to switch between byte/patch packing ()
Summary:

Test Plan:

```
python -m bytelatent.train config=../internal-blt/configs/entropy_model.yaml logging.wandb=null checkpoint.dump.every=1000 checkpoint.eval.every=100000 eval=null

pytest bytelatent/
```
2025-02-25 11:10:59 -08:00
Pedro Rodriguez
fc3399ef40
Update iterator inheritance, pass file format args, limit iterator ()
- Create a common class to use in all inheritance for states
- Add a limit iterator that we can use in evals
- Modify ArrowFileIterator behavior to not do arrow path inference if file_format='json'
- Make EvalArgs valid
- Move testing iterators to a common directory to allow usage in multiple test files
- Make it so that SequenceIterator can take a None rng_state, to disable all rng ops (for eval mainly)

Test Plan:

- `pytest bytelatent`
- `python -m bytelatent.train config=../internal-blt/configs/entropy_model.yaml logging.wandb=null eval=null`
2025-02-21 16:21:07 -08:00
Pedro Rodriguez
8c61ab5e67
Fix multiprocessing dataloader checkpointing and use it in the train script () 2025-02-13 11:58:23 -08:00
Pedro Rodriguez
85c2f28f26
Test first batch matches ()
Summary:

Test Plan:
2025-02-13 10:05:08 -08:00
Pedro Rodriguez
936d9437be
Allow ArrowIterator to read from json ()
Summary:

Currently, arrow iterator can only read arrow files. However, the pyarrow library can read
other formats, including jsonlines. This allows the same ArrowIterator to read from jsonlines,
so we can read from the original source data, and simply omit the entropy column when doing so

Test Plan:

Run train script until dataloader starts
2025-02-06 09:57:22 -08:00
Pedro Rodriguez
7044771a12
This includes fixes that make checkpointing and reloading work correctly. ()
It also batches in a first set of changes for fixing eval code

Summary:

Test Plan:
2025-01-27 16:56:42 -08:00
Pedro Rodriguez
7622d28b74
Initial codes and scripts for training entropy model ()
Summary:

Test Plan:
2025-01-27 09:46:44 -08:00
Pedro Rodriguez
bc42cebd7d
Update file check script to check sizes ()
Summary:

Test Plan:
2025-01-22 13:06:46 -08:00
Ink
392117bff2
Fix realtime entropy patching ()
* allow loading of the entropy model directly

* remove unused argument

* remove spammy warning

* allow patch_batch_size to be adjusted in the forward() method

* revert to original patcher style, fix warning

* allow grads when calculating entropies

* fix grad flow

* return preds from calculate_entropies()

* remove legacy arg

* fix an error with monotonicity and small sequence lengths

* ensure patcher is serializable

* revert patcher to original

* remove unused import
2025-01-21 16:34:23 -08:00
Pedro Rodriguez
6ffeb66b53
Changes for training entropy model and correcting attention in local models ()
Summary:

- Refactor local model configs to be separate and clearer
- Add attention arguments and correct which attention is used in local models
- Preparation for being able to have an entropy train script
- Fix failing unit tests

Test Plan:
2025-01-17 14:23:01 -08:00
Pedro Rodriguez
1da3dd9315
Update preprocess_entropies script to blt inference + add fsspec support ()
Summary:

Test Plan:
2025-01-13 15:28:14 -08:00
Pedro Rodriguez
b0120da72f
Replace regular filesystem calls with fsspec + add s3 support ()
Summary:

For compatibility with either local/nfs or S3 datasets, swap to fsspec.

Add a tool to compare local and remote filesystems

Test Plan:

- Ran regular train script
- Ran with config with data in S3
2025-01-10 11:04:41 -08:00
Pedro Rodriguez
bcc039bb75 Initial commit 2024-12-12 15:32:30 -08:00