Skip to content

Commit

Permalink
Upgrade to DJL 0.24.0 (#379)
Browse files Browse the repository at this point in the history
* Upgrade to DJL 0.24.0

* Fix breaking changes to pass build
  • Loading branch information
zachgk committed Oct 27, 2023
1 parent 7300f0b commit 545800a
Show file tree
Hide file tree
Showing 33 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ org.gradle.jvmargs=-Xmx2048m --add-exports jdk.compiler/com.sun.tools.javac.api=
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
djl_version=0.23.0
djl_version=0.24.0
6 changes: 3 additions & 3 deletions apache-spark/notebook/Image_Classification_Spark.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"outputs": [],
"source": [
"import $ivy.`org.apache.spark::spark-sql:3.3.2`\n",
"import $ivy.`ai.djl:api:0.23.0`\n",
"import $ivy.`ai.djl.spark:spark:0.23.0`\n",
"import $ivy.`ai.djl.pytorch:pytorch-model-zoo:0.23.0`\n",
"import $ivy.`ai.djl:api:0.24.0`\n",
"import $ivy.`ai.djl.spark:spark:0.24.0`\n",
"import $ivy.`ai.djl.pytorch:pytorch-model-zoo:0.24.0`\n",
"import $ivy.`ai.djl.pytorch:pytorch-native-cpu-precxx11:1.13.1`\n",
"// import $ivy.`ai.djl.mxnet:mxnet-engine:0.21.0`\n",
"// import $ivy.`ai.djl.mxnet:mxnet-native-mkl:1.9.1`"
Expand Down
6 changes: 3 additions & 3 deletions apache-spark/notebook/Text_Embedding_Spark.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"outputs": [],
"source": [
"import $ivy.`org.apache.spark::spark-sql:3.3.2`\n",
"import $ivy.`ai.djl:api:0.23.0`\n",
"import $ivy.`ai.djl.spark:spark:0.23.0`\n",
"import $ivy.`ai.djl.pytorch:pytorch-model-zoo:0.23.0`\n",
"import $ivy.`ai.djl:api:0.24.0`\n",
"import $ivy.`ai.djl.spark:spark:0.24.0`\n",
"import $ivy.`ai.djl.pytorch:pytorch-model-zoo:0.24.0`\n",
"import $ivy.`ai.djl.pytorch:pytorch-native-cpu-precxx11:1.13.1`"
]
},
Expand Down
4 changes: 2 additions & 2 deletions apache-spark/notebook/Text_Encoding_Spark.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"outputs": [],
"source": [
"import $ivy.`org.apache.spark::spark-sql:3.3.2`\n",
"import $ivy.`ai.djl:api:0.23.0`\n",
"import $ivy.`ai.djl.spark:spark:0.23.0`"
"import $ivy.`ai.djl:api:0.24.0`\n",
"import $ivy.`ai.djl.spark:spark:0.24.0`"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions apache-spark/notebook/Text_Tokenization_Spark.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"outputs": [],
"source": [
"import $ivy.`org.apache.spark::spark-sql:3.3.2`\n",
"import $ivy.`ai.djl:api:0.23.0`\n",
"import $ivy.`ai.djl.spark:spark:0.23.0`"
"import $ivy.`ai.djl:api:0.24.0`\n",
"import $ivy.`ai.djl.spark:spark:0.24.0`"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions apache-spark/spark3.0/audio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ We provide two options to build, you can choose to build with `sbt` or `gradle`.
### sbt

```
libraryDependencies += "ai.djl.spark" % "spark_2.12" % "0.23.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-engine" % "0.23.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-model-zoo" % "0.23.0"
libraryDependencies += "ai.djl.spark" % "spark_2.12" % "0.24.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-engine" % "0.24.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-model-zoo" % "0.24.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-native-cpu-precxx11" % "1.13.1"
```

Expand Down
6 changes: 3 additions & 3 deletions apache-spark/spark3.0/audio/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ scalacOptions += "-target:jvm-1.8"

resolvers += Resolver.jcenterRepo

libraryDependencies += "ai.djl.spark" % "spark_2.12" % "0.23.0"
libraryDependencies += "ai.djl.spark" % "spark_2.12" % "0.24.0"

libraryDependencies += "ai.djl.pytorch" % "pytorch-engine" % "0.23.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-model-zoo" % "0.23.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-engine" % "0.24.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-model-zoo" % "0.24.0"
// libraryDependencies += "ai.djl.pytorch" % "pytorch-native-cpu-precxx11" % "1.13.1"
6 changes: 3 additions & 3 deletions apache-spark/spark3.0/image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ We provide two options to build, you can choose to build with `sbt` or `gradle`.
### sbt

```
libraryDependencies += "ai.djl.spark" % "spark_2.12" % "0.23.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-engine" % "0.23.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-model-zoo" % "0.23.0"
libraryDependencies += "ai.djl.spark" % "spark_2.12" % "0.24.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-engine" % "0.24.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-model-zoo" % "0.24.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-native-cpu-precxx11" % "1.13.1"
```

Expand Down
10 changes: 5 additions & 5 deletions apache-spark/spark3.0/image/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ scalacOptions += "-target:jvm-1.8"

resolvers += Resolver.jcenterRepo

libraryDependencies += "ai.djl.spark" % "spark_2.12" % "0.23.0"
libraryDependencies += "ai.djl.spark" % "spark_2.12" % "0.24.0"

// libraryDependencies += "ai.djl.mxnet" % "mxnet-engine" % "0.23.0"
// libraryDependencies += "ai.djl.mxnet" % "mxnet-engine" % "0.24.0"
// libraryDependencies += "ai.djl.mxnet" % "mxnet-native-mkl" % "1.9.1"

libraryDependencies += "ai.djl.pytorch" % "pytorch-engine" % "0.23.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-model-zoo" % "0.23.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-engine" % "0.24.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-model-zoo" % "0.24.0"
// libraryDependencies += "ai.djl.pytorch" % "pytorch-native-cpu-precxx11" % "1.13.1"

// libraryDependencies += "ai.djl.tensorflow" % "tensorflow-engine" % "0.23.0"
// libraryDependencies += "ai.djl.tensorflow" % "tensorflow-engine" % "0.24.0"
// libraryDependencies += "ai.djl.tensorflow" % "tensorflow-native-cpu" % "2.10.1"
6 changes: 3 additions & 3 deletions apache-spark/spark3.0/text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ We provide two options to build, you can choose to build with `sbt` or `gradle`.
### sbt

```
libraryDependencies += "ai.djl.spark" % "spark_2.12" % "0.23.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-engine" % "0.23.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-model-zoo" % "0.23.0"
libraryDependencies += "ai.djl.spark" % "spark_2.12" % "0.24.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-engine" % "0.24.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-model-zoo" % "0.24.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-native-cpu-precxx11" % "1.13.1"
```

Expand Down
2 changes: 1 addition & 1 deletion apache-spark/spark3.0/text/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repositories {
}

dependencies {
implementation platform("ai.djl:bom:0.23.0-SNAPSHOT")
implementation platform("ai.djl:bom:0.24.0")
implementation "ai.djl.spark:spark_2.12"
runtimeOnly "ai.djl.pytorch:pytorch-model-zoo"
runtimeOnly "ai.djl.huggingface:tokenizers"
Expand Down
10 changes: 5 additions & 5 deletions apache-spark/spark3.0/text/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ scalacOptions += "-target:jvm-1.8"

resolvers += Resolver.jcenterRepo

libraryDependencies += "ai.djl" % "api" % "0.23.0"
libraryDependencies += "ai.djl.spark" % "spark_2.12" % "0.23.0"
libraryDependencies += "ai.djl" % "api" % "0.24.0"
libraryDependencies += "ai.djl.spark" % "spark_2.12" % "0.24.0"

libraryDependencies += "ai.djl.pytorch" % "pytorch-engine" % "0.23.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-model-zoo" % "0.23.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-engine" % "0.24.0"
libraryDependencies += "ai.djl.pytorch" % "pytorch-model-zoo" % "0.24.0"

// libraryDependencies += "ai.djl.tensorflow" % "tensorflow-engine" % "0.23.0"
// libraryDependencies += "ai.djl.tensorflow" % "tensorflow-engine" % "0.24.0"
// libraryDependencies += "ai.djl.tensorflow" % "tensorflow-native-cpu" % "2.10.1"
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"image_uri = image_uris.retrieve(\n",
" framework=\"djl-fastertransformer\",\n",
" region=sess.boto_session.region_name,\n",
" version=\"0.23.0\"\n",
" version=\"0.24.0\"\n",
" )"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"image_uri = image_uris.retrieve(\n",
" framework=\"djl-deepspeed\",\n",
" region=sess.boto_session.region_name,\n",
" version=\"0.23.0\"\n",
" version=\"0.24.0\"\n",
" )"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"image_uri = image_uris.retrieve(\n",
" framework=\"djl-deepspeed\",\n",
" region=sess.boto_session.region_name,\n",
" version=\"0.23.0\"\n",
" version=\"0.24.0\"\n",
" )"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"image_uri = image_uris.retrieve(\n",
" framework=\"djl-deepspeed\",\n",
" region=sess.boto_session.region_name,\n",
" version=\"0.23.0\"\n",
" version=\"0.24.0\"\n",
" )"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"image_uri = image_uris.retrieve(\n",
" framework=\"djl-deepspeed\",\n",
" region=sess.boto_session.region_name,\n",
" version=\"0.23.0\"\n",
" version=\"0.24.0\"\n",
" )"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"image_uri = image_uris.retrieve(\n",
" framework=\"djl-deepspeed\",\n",
" region=sess.boto_session.region_name,\n",
" version=\"0.23.0\"\n",
" version=\"0.24.0\"\n",
" )"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"source": [
"# inference_image_uri = f\"{account_id}.dkr.ecr.{region}.amazonaws.com/djl-ds:latest\"\n",
"inference_image_uri = (\n",
" f\"763104351884.dkr.ecr.{region}.amazonaws.com/djl-inference:0.23.0-deepspeed0.9.5-cu118\"\n",
" f\"763104351884.dkr.ecr.{region}.amazonaws.com/djl-inference:0.24.0-deepspeed0.9.5-cu118\"\n",
")\n",
"print(f\"Image going to be used is ---- > {inference_image_uri}\")"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"image_uri = image_uris.retrieve(\n",
" framework=\"djl-deepspeed\",\n",
" region=sess.boto_session.region_name,\n",
" version=\"0.23.0\"\n",
" version=\"0.24.0\"\n",
" )"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"image_uri = image_uris.retrieve(\n",
" framework=\"djl-deepspeed\",\n",
" region=sess.boto_session.region_name,\n",
" version=\"0.23.0\"\n",
" version=\"0.24.0\"\n",
" )"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"id": "1a0ab053",
"metadata": {},
"source": [
"In this step, we will try to override the [default HuggingFace handler](https://github.com/deepjavalibrary/djl-serving/blob/0.23.0-dlc/engines/python/setup/djl_python/huggingface.py#L202) provided by DJLServing. We will add an extra parameter checker called `password` to see if password is correct in the payload."
"In this step, we will try to override the [default HuggingFace handler](https://github.com/deepjavalibrary/djl-serving/blob/0.24.0-dlc/engines/python/setup/djl_python/huggingface.py#L202) provided by DJLServing. We will add an extra parameter checker called `password` to see if password is correct in the payload."
]
},
{
Expand Down Expand Up @@ -194,7 +194,7 @@
"image_uri = image_uris.retrieve(\n",
" framework=\"djl-deepspeed\",\n",
" region=sess.boto_session.region_name,\n",
" version=\"0.23.0\"\n",
" version=\"0.24.0\"\n",
" )"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@
"### Getting the container image URI\n",
"\n",
"Available framework are:\n",
"- djl-deepspeed (0.21.0, 0.22.1, 0.23.0)\n",
"- djl-fastertransformer (0.21.0, 0.22.1, 0.23.0)\n",
"- djl-neuronx (0.22.1, 0.23.0)"
"- djl-deepspeed (0.21.0, 0.22.1, 0.23.0, 0.24.0)\n",
"- djl-fastertransformer (0.21.0, 0.22.1, 0.23.0, 0.24.0)\n",
"- djl-neuronx (0.22.1, 0.23.0, 0.24.0)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"source": [
"docker_registry=\"deepjavalibrary\"\n",
"repository_name=\"djl-spark\"\n",
"tag=\"0.23.0-cpu\"\n",
"tag=\"0.24.0-cpu\"\n",
"ecr_registry=\"{}.dkr.ecr.{}.amazonaws.com\".format(account_id, region)\n",
"\n",
"# Pull the DJL Spark image\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"source": [
"docker_registry=\"deepjavalibrary\"\n",
"repository_name=\"djl-spark\"\n",
"tag=\"0.23.0-cpu\"\n",
"tag=\"0.24.0-cpu\"\n",
"ecr_registry=\"{}.dkr.ecr.{}.amazonaws.com\".format(account_id, region)\n",
"\n",
"# Pull the DJL Spark image\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"source": [
"docker_registry=\"deepjavalibrary\"\n",
"repository_name=\"djl-spark\"\n",
"tag=\"0.23.0-cpu\"\n",
"tag=\"0.24.0-cpu\"\n",
"ecr_registry=\"{}.dkr.ecr.{}.amazonaws.com\".format(account_id, region)\n",
"\n",
"# Pull the DJL Spark image\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"source": [
"docker_registry=\"deepjavalibrary\"\n",
"repository_name=\"djl-spark\"\n",
"tag=\"0.23.0-cpu\"\n",
"tag=\"0.24.0-cpu\"\n",
"ecr_registry=\"{}.dkr.ecr.{}.amazonaws.com\".format(account_id, region)\n",
"\n",
"# Pull the DJL Spark image\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"source": [
"docker_registry=\"deepjavalibrary\"\n",
"repository_name=\"djl-spark\"\n",
"tag=\"0.23.0-cpu\"\n",
"tag=\"0.24.0-cpu\"\n",
"ecr_registry=\"{}.dkr.ecr.{}.amazonaws.com\".format(account_id, region)\n",
"\n",
"# Pull the DJL Spark image\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"source": [
"docker_registry=\"deepjavalibrary\"\n",
"repository_name=\"djl-spark\"\n",
"tag=\"0.23.0-cpu\"\n",
"tag=\"0.24.0-cpu\"\n",
"ecr_registry=\"{}.dkr.ecr.{}.amazonaws.com\".format(account_id, region)\n",
"\n",
"# Pull the DJL Spark image\n",
Expand Down
2 changes: 1 addition & 1 deletion djl-serving/java-client/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=60000
# FIXME: Workaround gradle publish issue: https://github.com/gradle/gradle/issues/11308
systemProp.org.gradle.internal.publish.checksums.insecure=true

djl_version=0.23.0
djl_version=0.24.0
commons_cli_version=1.5.0
log4j_slf4j_version=2.19.0
slf4j_simple_version=1.7.36
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static class SAFlatMap implements FlatMapFunction<String, Classifications
.optProgress(new ProgressBar())
.build();
modelInfo = new ModelInfo<>("model", url, criteria);
wlm.registerModel(modelInfo).scaleWorkers(null, 1, 4);
wlm.registerWorkerPool(modelInfo).scaleWorkers(null, 1, 4);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public CompletableFuture<WorkflowExpression.Item> run(

// Add to output
output.addProperty("Content-Type", "tensor/npz");
output.add(batched.encode(true));
output.add(batched.encode(NDList.Encoding.NPZ));

// Attach the NDList resource to NDManager to avoid memory leak
manager.tempAttachAll(batched);
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ systemProp.org.gradle.internal.http.connectionTimeout=60000
# FIXME: Workaround gradle publish issue: https://github.com/gradle/gradle/issues/11308
systemProp.org.gradle.internal.publish.checksums.insecure=true

djl_version=0.23.0
djl_version=0.24.0
commons_cli_version=1.5.0
log4j_slf4j_version=2.19.0
slf4j_simple_version=1.7.36
Expand Down

0 comments on commit 545800a

Please sign in to comment.