From b092ee31f138f724145f44c4a20b4b959044f525 Mon Sep 17 00:00:00 2001 From: Frank Liu Date: Mon, 17 Jun 2024 13:09:04 -0700 Subject: [PATCH] [pytorch] Updates PyTorch to 2.3.1 --- .github/workflows/continuous.yml | 2 +- .github/workflows/native_jni_s3_pytorch.yml | 12 ++++++++---- .github/workflows/nightly_publish.yml | 8 +++----- gradle/libs.versions.toml | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index 6bfd6076732..ae08f4bf92a 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -26,7 +26,7 @@ jobs: runs-on: ${{ matrix.operating-system }} strategy: matrix: - operating-system: [ ubuntu-latest, macos-13 ] + operating-system: [ ubuntu-latest, macos-latest ] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/native_jni_s3_pytorch.yml b/.github/workflows/native_jni_s3_pytorch.yml index d29bb62b191..a84b2bc034d 100644 --- a/.github/workflows/native_jni_s3_pytorch.yml +++ b/.github/workflows/native_jni_s3_pytorch.yml @@ -37,8 +37,10 @@ jobs: PYTORCH_VERSION=${{ github.event.inputs.pt_version }} export PYTORCH_VERSION=${PYTORCH_VERSION:-$(awk -F '=' '/pytorch/ {gsub(/ ?"/, "", $2); print $2}' gradle/libs.versions.toml)} echo $PYTORCH_VERSION - ./gradlew :engines:pytorch:pytorch-native:compileJNI -Ppt_version=$PYTORCH_VERSION - ./gradlew -Pjni -Ppt_version=$PYTORCH_VERSION :integration:test "-Dai.djl.default_engine=PyTorch" + if [[ $PYTORCH_VERSION =~ ^(?\.[1-2]?\..*)$ ]]; then \ + ./gradlew :engines:pytorch:pytorch-native:compileJNI -Ppt_version=$PYTORCH_VERSION; \ + ./gradlew -Pjni -Ppt_version=$PYTORCH_VERSION :integration:test "-Dai.djl.default_engine=PyTorch"; \ + fi; - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: @@ -50,8 +52,10 @@ jobs: run: | PYTORCH_VERSION=${{ github.event.inputs.pt_version }} PYTORCH_VERSION=${PYTORCH_VERSION:-$(awk -F '=' '/pytorch/ {gsub(/ ?"/, "", $2); print $2}' gradle/libs.versions.toml)} - aws s3 sync engines/pytorch/pytorch-native/jnilib s3://djl-ai/publish/pytorch/${PYTORCH_VERSION}/jnilib - aws cloudfront create-invalidation --distribution-id E371VB8JQ6NRVY --paths "/pytorch/${PYTORCH_VERSION}/jnilib*" + if [[ $PYTORCH_VERSION =~ ^(?\.[1-2]?\..*)$ ]]; then \ + aws s3 sync engines/pytorch/pytorch-native/jnilib s3://djl-ai/publish/pytorch/${PYTORCH_VERSION}/jnilib; \ + aws cloudfront create-invalidation --distribution-id E371VB8JQ6NRVY --paths "/pytorch/${PYTORCH_VERSION}/jnilib*"; \ + fi; build-pytorch-jni-linux: if: github.repository == 'deepjavalibrary/djl' diff --git a/.github/workflows/nightly_publish.yml b/.github/workflows/nightly_publish.yml index e52f042afcc..1469f997501 100644 --- a/.github/workflows/nightly_publish.yml +++ b/.github/workflows/nightly_publish.yml @@ -16,7 +16,7 @@ jobs: runs-on: ${{ matrix.operating-system }} strategy: matrix: - operating-system: [ macos-13, ubuntu-latest ] + operating-system: [ macos-latest, ubuntu-latest ] steps: - uses: actions/checkout@v4 @@ -189,9 +189,8 @@ jobs: if: ${{ github.event.inputs.mode == '' || github.event.inputs.mode == 'snapshot' }} run: | ./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=1.13.1 -Psnapshot - ./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=2.1.2 -Psnapshot ./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=2.2.2 -Psnapshot - ./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=2.3.0 -Psnapshot + ./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=2.3.1 -Psnapshot ./gradlew clean engines:ml:xgboost:publish -Pgpu -Psnapshot ./gradlew clean publish -Psnapshot cd bom @@ -205,9 +204,8 @@ jobs: if: ${{ github.event.inputs.mode == 'staging' }} run: | ./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=1.13.1 -P${{ github.event.inputs.mode }} - ./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=2.1.2 -P${{ github.event.inputs.mode }} ./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=2.2.2 -P${{ github.event.inputs.mode }} - ./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=2.3.0 -P${{ github.event.inputs.mode }} + ./gradlew clean engines:pytorch:pytorch-jni:publish -Ppt_version=2.3.1 -P${{ github.event.inputs.mode }} ./gradlew clean engines:ml:xgboost:publish -Pgpu -P${{ github.event.inputs.mode }} ./gradlew clean publish -P${{ github.event.inputs.mode }} cd bom diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d9c2ecf3fac..4bde8af3609 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ format.version = "1.1" [versions] djl = "0.29.0" -pytorch = "2.2.2" +pytorch = "2.3.1" tensorflow = "2.10.1" tensorflowCore = "0.5.0" mxnet = "1.9.1"