-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from poolsideai/devdocs
Add development docs
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 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,49 @@ | ||
# Testing sentencepiece | ||
|
||
The commands below are tested in the poolside-sentencepiece Docker image | ||
([Dockerfile](https://github.com/poolsideai/orchestrator/blob/main/encoder/Dockerfile.dev)). | ||
|
||
## Build | ||
|
||
For a clean build, delete the build folder if one already exists. Then run the | ||
following command which uses `ninja-build`: | ||
|
||
```bash | ||
cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D SPM_ENABLE_TCMALLOC=on \ | ||
-D SPM_ENABLE_NFKC_COMPILE=on -D SPM_ENABLE_SHARED=off \ | ||
-D SPM_SANITIZE=off -D SPM_DISABLE_LTO=off \ | ||
-S . -B build -G Ninja | ||
``` | ||
|
||
Note: The `-S` option specifies path to source, and `-B` specifies path to | ||
build. | ||
|
||
Then you have to call the following command to actually build the targets. | ||
|
||
``` | ||
cmake --build build | ||
``` | ||
|
||
## Test | ||
|
||
For testing, you have to build the project as before, but you have to pass in | ||
`-DSPM_BUILD_TEST=ON` to build the test targets: | ||
|
||
```bash | ||
cmake -D SPM_BUILD_TEST=ON -D CMAKE_BUILD_TYPE=RelWithDebInfo -D SPM_ENABLE_TCMALLOC=on \ | ||
-D SPM_ENABLE_NFKC_COMPILE=on -D SPM_ENABLE_SHARED=off \ | ||
-D SPM_SANITIZE=off -D SPM_DISABLE_LTO=off \ | ||
-S . -B build -GNinja | ||
``` | ||
|
||
Run the following command as before: | ||
|
||
```bash | ||
cmake --build build | ||
``` | ||
|
||
Finally, run the following command to build and run the tests. | ||
|
||
``` | ||
cmake --build build --target test | ||
``` |