-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CONTRIBUTING.md for bpe explaining project structure and benchmar…
…k instructions
- Loading branch information
1 parent
02118ef
commit ed45357
Showing
2 changed files
with
39 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Contributing | ||
|
||
Here are specific details that are useful when you want to contribute to the BPE crates. | ||
Make sure to read the repository's [contribution guidelines][contributing] as well. | ||
|
||
## Project structure | ||
|
||
This project has a slightly unusual structure to resolve some dependency issues. | ||
|
||
- This directory contains `bpe`, the BPE code itself. | ||
- A sibling directory contains `bpe-openai`, which exposes tokenizers for OpenAI token sets, and depends on `bpe`. | ||
- Tests are located in the `tests` subdirectory, and benchmarks in the `benchmarks` subdirectory. Both of these are separate crates so they can depend on `bpe-openai` without causing a cyclic dependency. | ||
|
||
Only the `bpe` and `bpe-openai` crates are meant to be published. The other ones are for development use only. | ||
|
||
## Running benchmarks | ||
|
||
Change the working directory to the `benchmarks` directory: | ||
|
||
```sh | ||
cd benchmarks | ||
``` | ||
|
||
Run the benchmark as follows (required [cargo-criterion](https://crates.io/crates/cargo-criterion) installed): | ||
|
||
```sh | ||
cargo criterion | ||
``` | ||
|
||
(Using `cargo bench` ignores the settings in `criterion.toml`!) | ||
Open the full report which should be located in `target/criterion/reports/index.html`. | ||
|
||
Update the figures in this repo as follows (requires `rsvg-convert` from `librsvg` installed): | ||
|
||
```sh | ||
script/copy-results | ||
``` | ||
|
||
[contributing]: ../../CONTRIBUTING.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters