Skip to content

Commit

Permalink
* Upgrade presets for SentencePiece 0.2.0, TensorFlow Lite 2.16.1, T…
Browse files Browse the repository at this point in the history
…ensorRT 10.0.1.6, Triton Inference Server 2.44.0
  • Loading branch information
saudet committed Apr 29, 2024
1 parent 42db5fe commit f53a152
Show file tree
Hide file tree
Showing 401 changed files with 7,924 additions and 7,488 deletions.
8 changes: 4 additions & 4 deletions .github/actions/deploy-ubuntu/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,16 @@ runs:
if [[ "$CI_DEPLOY_PLATFORM" == "linux-arm64" ]] && [[ "$CI_DEPLOY_MODULE" == "tensorrt" ]]; then
echo Installing TensorRT
# python3 -m gdown.cli https://drive.google.com/uc?id=1LZRCv4ZAGiDQAu4pvADJIGntq4cGl5tU
curl -LO https://github.com/bytedeco/binaries/releases/download/1.5.10/TensorRT-8.6.1.6.Ubuntu-20.04.aarch64-gnu.cuda-12.0.tar.gz
$SUDO tar -hxvf TensorRT-8.6.1.6.Ubuntu-20.04.aarch64-gnu.cuda-12.0.tar.gz -C /usr/local/
curl -LO https://developer.download.nvidia.com/compute/machine-learning/tensorrt/10.0.1/tars/TensorRT-10.0.1.6.Ubuntu-22.04.aarch64-gnu.cuda-12.4.tar.gz
$SUDO tar -hxvf TensorRT-10.0.1.6.Ubuntu-22.04.aarch64-gnu.cuda-12.4.tar.gz -C /usr/local/
$SUDO ln -sf /usr/local/TensorRT* /usr/local/tensorrt
fi
if [[ "$CI_DEPLOY_PLATFORM" == "linux-x86_64" ]] && [[ "$CI_DEPLOY_MODULE" == "tensorrt" ]]; then
echo Installing TensorRT
# python3 -m gdown.cli https://drive.google.com/uc?id=1dVhD-DEYY42QbZe1GXl-vxe3k6KqWGsL
curl -LO https://github.com/bytedeco/binaries/releases/download/1.5.10/TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-12.0.tar.gz
$SUDO tar -hxvf TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-12.0.tar.gz -C /usr/local/
curl -LO https://developer.download.nvidia.com/compute/machine-learning/tensorrt/10.0.1/tars/TensorRT-10.0.1.6.Linux.x86_64-gnu.cuda-12.4.tar.gz
$SUDO tar -hxvf TensorRT-10.0.1.6.Linux.x86_64-gnu.cuda-12.4.tar.gz -C /usr/local/
$SUDO ln -sf /usr/local/TensorRT* /usr/local/tensorrt
fi
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/deploy-windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ runs:
if "%CI_DEPLOY_MODULE%"=="tensorrt" (
echo Installing TensorRT
rem python -m gdown.cli https://drive.google.com/uc?id=1GfmJ1BKbacLpUU-0i_mGu0sjrAS0Xzzi
curl -LO https://github.com/bytedeco/binaries/releases/download/1.5.10/TensorRT-8.6.1.6.Windows10.x86_64.cuda-12.0.zip
unzip TensorRT-8.6.1.6.Windows10.x86_64.cuda-12.0.zip
move TensorRT-8.6.1.6 "%ProgramFiles%\NVIDIA GPU Computing Toolkit\TensorRT"
curl -LO https://developer.download.nvidia.com/compute/machine-learning/tensorrt/10.0.1/zip/TensorRT-10.0.1.6.Windows10.win10.cuda-12.4.zip
unzip TensorRT-10.0.1.6.Windows10.win10.cuda-12.4.zip
move TensorRT-10.0.1.6 "%ProgramFiles%\NVIDIA GPU Computing Toolkit\TensorRT"
)
if "%CI_DEPLOY_MODULE%"=="mkl" (
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tritonserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ env:
jobs:
linux-x86_64:
runs-on: ubuntu-20.04
container: nvcr.io/nvidia/tritonserver:23.12-py3
container: nvcr.io/nvidia/tritonserver:24.03-py3
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Build FFmpeg with zimg to enable zscale filter ([pull #1481](https://github.com/bytedeco/javacpp-presets/pull/1481))
* Enable PulseAudio support for FFmpeg on Linux ([pull #1472](https://github.com/bytedeco/javacpp-presets/pull/1472))
* Virtualize `btCollisionWorld`, `btOverlapFilterCallback`, `btOverlapCallback` from Bullet Physics SDK ([pull #1475](https://github.com/bytedeco/javacpp-presets/pull/1475))
* Upgrade presets for FFmpeg 7.0, DNNL 3.4.1, PyTorch 2.2.2 ([pull #1466](https://github.com/bytedeco/javacpp-presets/pull/1466)), ONNX 1.16.0, ONNX Runtime 1.17.3, TVM 0.15.0, and their dependencies
* Upgrade presets for FFmpeg 7.0, DNNL 3.4.1, PyTorch 2.2.2 ([pull #1466](https://github.com/bytedeco/javacpp-presets/pull/1466)), SentencePiece 0.2.0, TensorFlow Lite 2.16.1, TensorRT 10.0.1.6, Triton Inference Server 2.44.0, ONNX 1.16.0, ONNX Runtime 1.17.3, TVM 0.15.0, and their dependencies

### January 29, 2024 version 1.5.10
* Introduce `macosx-arm64` builds for PyTorch ([pull #1463](https://github.com/bytedeco/javacpp-presets/pull/1463))
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ The JavaCPP Presets depend on Maven, a powerful build system for Java, so before
Each child module in turn relies by default on the included [`cppbuild.sh` scripts](#the-cppbuildsh-scripts), explained below, to install its corresponding native libraries in the `cppbuild` subdirectory. To use native libraries already installed somewhere else on the system, other installation directories than `cppbuild` can also be specified either in the `pom.xml` files or in the `.java` configuration files. The following versions are supported:

* OpenCV 4.9.x https://opencv.org/releases/
* FFmpeg 6.1.x http://ffmpeg.org/download.html
* FFmpeg 7.0.x http://ffmpeg.org/download.html
* FlyCapture 2.13.x https://www.flir.com/products/flycapture-sdk
* Spinnaker 3.0.x https://www.flir.com/products/spinnaker-sdk
* libdc1394 2.2.6 http://sourceforge.net/projects/libdc1394/files/
Expand All @@ -198,7 +198,7 @@ Each child module in turn relies by default on the included [`cppbuild.sh` scrip
* LZ4 1.9.x https://github.com/lz4/lz4
* MKL 2024.x https://software.intel.com/mkl
* MKL-DNN 0.21.x https://github.com/oneapi-src/oneDNN
* DNNL 3.3.x https://github.com/oneapi-src/oneDNN
* DNNL 3.4.x https://github.com/oneapi-src/oneDNN
* OpenBLAS 0.3.26 http://www.openblas.net/
* ARPACK-NG 3.9.x https://github.com/opencollab/arpack-ng
* CMINPACK 1.3.8 https://github.com/devernay/cminpack
Expand All @@ -223,18 +223,18 @@ Each child module in turn relies by default on the included [`cppbuild.sh` scrip
* NVIDIA Video Codec SDK 12.1.x https://developer.nvidia.com/nvidia-video-codec-sdk
* OpenCL 3.0.x https://github.com/KhronosGroup/OpenCL-ICD-Loader
* MXNet 1.9.x https://github.com/apache/incubator-mxnet
* PyTorch 2.1.x https://github.com/pytorch/pytorch
* SentencePiece 0.1.99 https://github.com/google/sentencepiece
* PyTorch 2.2.x https://github.com/pytorch/pytorch
* SentencePiece 0.2.0 https://github.com/google/sentencepiece
* TensorFlow 1.15.x https://github.com/tensorflow/tensorflow
* TensorFlow Lite 2.15.x https://github.com/tensorflow/tensorflow
* TensorRT 8.6.x https://developer.nvidia.com/tensorrt
* Triton Inference Server 2.41.x https://developer.nvidia.com/nvidia-triton-inference-server
* TensorFlow Lite 2.16.x https://github.com/tensorflow/tensorflow
* TensorRT 10.0.x https://developer.nvidia.com/tensorrt
* Triton Inference Server 2.44.x https://developer.nvidia.com/nvidia-triton-inference-server
* The Arcade Learning Environment 0.8.x https://github.com/mgbellemare/Arcade-Learning-Environment
* DepthAI 2.24.x https://github.com/luxonis/depthai-core
* ONNX 1.15.x https://github.com/onnx/onnx
* ONNX 1.16.x https://github.com/onnx/onnx
* nGraph 0.26.0 https://github.com/NervanaSystems/ngraph
* ONNX Runtime 1.16.x https://github.com/microsoft/onnxruntime
* TVM 0.14.x https://github.com/apache/tvm
* ONNX Runtime 1.17.x https://github.com/microsoft/onnxruntime
* TVM 0.15.x https://github.com/apache/tvm
* Bullet Physics SDK 3.25 https://pybullet.org
* LiquidFun http://google.github.io/liquidfun/
* Qt 5.15.x https://download.qt.io/archive/qt/
Expand Down
8 changes: 4 additions & 4 deletions platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>sentencepiece-platform</artifactId>
<version>0.1.99-${project.version}</version>
<version>0.2.0-${project.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.bytedeco</groupId>-->
Expand All @@ -307,17 +307,17 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>tensorflow-lite-platform</artifactId>
<version>2.15.0-${project.version}</version>
<version>2.16.1-${project.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>tensorrt-platform</artifactId>
<version>8.6-${project.version}</version>
<version>10.0-${project.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>tritonserver-platform</artifactId>
<version>2.41-${project.version}</version>
<version>2.44-${project.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.bytedeco</groupId>-->
Expand Down
8 changes: 4 additions & 4 deletions sentencepiece/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Introduction
------------
This directory contains the JavaCPP Presets module for:

* SentencePiece 0.1.99 https://github.com/google/sentencepiece
* SentencePiece 0.2.0 https://github.com/google/sentencepiece

Please refer to the parent README.md file for more detailed information about the JavaCPP Presets.

Expand All @@ -25,7 +25,7 @@ Sample Usage
------------
Here is a simple example of SentencePiece ported to Java from this C++ example:

* https://github.com/google/sentencepiece/blob/v0.1.99/doc/api.md
* https://github.com/google/sentencepiece/blob/v0.2.0/doc/api.md

We can use [Maven 3](http://maven.apache.org/) to download and install automatically all the class files as well as the native binaries. To run this sample code, after creating the `pom.xml` and `SentencePieceExample.java` source files below, simply execute on the command line:
```bash
Expand All @@ -39,7 +39,7 @@ $ mvn compile exec:java exec.args="en.wiki.bpe.vs10000.model"
<modelVersion>4.0.0</modelVersion>
<groupId>org.bytedeco.sentencepiece</groupId>
<artifactId>sentencepiece-example</artifactId>
<version>1.5.10</version>
<version>1.5.11-SNAPSHOT</version>
<properties>
<exec.mainClass>SentencePieceExample</exec.mainClass>
<maven.compiler.source>1.8</maven.compiler.source>
Expand All @@ -49,7 +49,7 @@ $ mvn compile exec:java exec.args="en.wiki.bpe.vs10000.model"
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>sentencepiece-platform</artifactId>
<version>0.1.99-1.5.10</version>
<version>0.2.0-1.5.11-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
Expand Down
2 changes: 1 addition & 1 deletion sentencepiece/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [[ -z "$PLATFORM" ]]; then
exit
fi

SENTENCEPIECE_VERSION=0.1.99
SENTENCEPIECE_VERSION=0.2.0
download https://github.com/google/sentencepiece/archive/refs/tags/v$SENTENCEPIECE_VERSION.zip sentencepiece-$SENTENCEPIECE_VERSION.zip

mkdir -p $PLATFORM
Expand Down
2 changes: 1 addition & 1 deletion sentencepiece/platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.bytedeco</groupId>
<artifactId>sentencepiece-platform</artifactId>
<version>0.1.99-${project.parent.version}</version>
<version>0.2.0-${project.parent.version}</version>
<name>JavaCPP Presets Platform for SentencePiece</name>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion sentencepiece/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>org.bytedeco</groupId>
<artifactId>sentencepiece</artifactId>
<version>0.1.99-${project.parent.version}</version>
<version>0.2.0-${project.parent.version}</version>
<name>JavaCPP Presets for SentencePiece</name>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion sentencepiece/samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>sentencepiece-platform</artifactId>
<version>0.1.99-1.5.11-SNAPSHOT</version>
<version>0.2.0-1.5.11-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand All @@ -7,7 +7,7 @@
import org.bytedeco.javacpp.annotation.*;

import static org.bytedeco.sentencepiece.global.sentencepiece.*;
// namespace pretokenizer
// namespace normalizer

// Iterator over the training sentences.
// Training sentences are loaded sequentially as follows:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;

import static org.bytedeco.sentencepiece.global.sentencepiece.*;


@Namespace("sentencepiece") @NoOffset @Properties(inherit = org.bytedeco.sentencepiece.presets.sentencepiece.class)
public class SentencePieceNormalizer extends Pointer {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public SentencePieceNormalizer(Pointer p) { super(p); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public SentencePieceNormalizer(long size) { super((Pointer)null); allocateArray(size); }
private native void allocateArray(long size);
@Override public SentencePieceNormalizer position(long position) {
return (SentencePieceNormalizer)super.position(position);
}
@Override public SentencePieceNormalizer getPointer(long i) {
return new SentencePieceNormalizer((Pointer)this).offsetAddress(i);
}

public SentencePieceNormalizer() { super((Pointer)null); allocate(); }
private native void allocate();





public native @ByVal Status LoadFromSerializedProto(@StdString String serialized);

public native @ByVal Status LoadFromRuleTSV(@StdString String filename);

public native @ByVal Status LoadFromRuleName(@StdString String name);

public native @ByVal Status Normalize(@StdString String input,
@StdString @Cast({"char*", "std::string*"}) BytePointer normalized);

public native @ByVal Status Normalize(@StdString String input,
@StdString @Cast({"char*", "std::string*"}) BytePointer normalized,
@Cast("size_t*") @StdVector SizeTPointer norm_to_orig);

public native @StdString String Normalize(@StdString String input);

public native NormalizerSpec mutable_normalizer_spec();

public native @StdString String serialized_model_proto();
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand Down Expand Up @@ -318,6 +318,21 @@ public class SentencePieceProcessor extends Pointer {
// #undef DEFINE_SPP_SERIALIZED_PROTO_IMPL
// #undef DEFINE_SPP_IMMUTABLE_PROTO_IMPL

//////////////////////////////////////////////////////////////
// Normalization methods.

// Normalize `input`.
public native @ByVal Status Normalize(@StdString String input,
@StdString @Cast({"char*", "std::string*"}) BytePointer normalized);

// Normalize `input`. Stores the utf8-byte offset from
// the normalized string to the original input.
public native @ByVal Status Normalize(@StdString String input,
@StdString @Cast({"char*", "std::string*"}) BytePointer normalized,
@Cast("size_t*") @StdVector SizeTPointer norm_to_orig);

public native @StdString String Normalize(@StdString String input);

//////////////////////////////////////////////////////////////
// Vocabulary management methods.
//
Expand Down Expand Up @@ -378,4 +393,9 @@ public class SentencePieceProcessor extends Pointer {
// returns immutable model proto as std::string.
// Useful to save the state of this instance via Python's pickle object.
public native @StdString String serialized_model_proto();

// Returns mutable normalizer_spec.
// Updating the intenral normalization during the encoding/decoding are not
// recommended and may result in unexpected behavior. Use at your own risk.
public native NormalizerSpec mutable_normalizer_spec();
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.10: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.sentencepiece;

Expand Down Expand Up @@ -62,6 +62,22 @@ public class SentencePieceTrainer extends Pointer {
public static native @ByVal Status Train(
@Const @ByRef StringStringMap kwargs);

// The same as above, but passes the list of sentences.
public static native @ByVal Status Train(@StdString String args,
@Const @ByRef StringVector sentences,
@StdString @Cast({"char*", "std::string*"}) BytePointer serialized_model_proto/*=nullptr*/);
public static native @ByVal Status Train(@StdString String args,
@Const @ByRef StringVector sentences);

// The same as above, but passes the list of sentences.
public static native @ByVal Status Train(
@Const @ByRef StringStringMap kwargs,
@Const @ByRef StringVector sentences,
@StdString @Cast({"char*", "std::string*"}) BytePointer serialized_model_proto/*=nullptr*/);
public static native @ByVal Status Train(
@Const @ByRef StringStringMap kwargs,
@Const @ByRef StringVector sentences);

// Handy function to make a normalizer spec from the pre-compiled
// normalization name. Do not use this method in production as it crashes
// When `name` is invalid. Useful for unittesting.
Expand Down
Loading

0 comments on commit f53a152

Please sign in to comment.