Skip to content

Commit

Permalink
Merge pull request #70 from sbrunk/pytorch-2.1.2
Browse files Browse the repository at this point in the history
- Update to PyTorch 2.1.2
- Enable MKL only on platforms where it's available
- Update MKL, openblas and sbt
  • Loading branch information
sbrunk committed Jan 2, 2024
2 parents 8a3f633 + 898c2bc commit c2f2f70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ ThisBuild / tlSitePublishBranch := Some("main")
ThisBuild / apiURL := Some(new URL("https://storch.dev/api/"))

val scrImageVersion = "4.0.34"
val pytorchVersion = "2.1.1"
val pytorchVersion = "2.1.2"
val cudaVersion = "12.3-8.9"
val openblasVersion = "0.3.23"
val mklVersion = "2023.1"
val openblasVersion = "0.3.25"
val mklVersion = "2024.0"
ThisBuild / scalaVersion := "3.3.1"
ThisBuild / javaCppVersion := "1.5.10-SNAPSHOT"
ThisBuild / resolvers ++= Resolver.sonatypeOssRepos("snapshots")
Expand All @@ -38,6 +38,11 @@ val enableGPU = settingKey[Boolean]("enable or disable GPU support")

ThisBuild / enableGPU := false

val hasMKL = {
val firstPlatform = org.bytedeco.sbt.javacpp.Platform.current.head
firstPlatform == "linux-x86_64" || firstPlatform == "windows-x86_64"
}

lazy val commonSettings = Seq(
Compile / doc / scalacOptions ++= Seq("-groups", "-snippet-compiler:compile"),
javaCppVersion := (ThisBuild / javaCppVersion).value,
Expand Down Expand Up @@ -73,9 +78,9 @@ lazy val core = project
.settings(
javaCppPresetLibs ++= Seq(
(if (enableGPU.value) "pytorch-gpu" else "pytorch") -> pytorchVersion,
"mkl" -> mklVersion,
"openblas" -> openblasVersion
) ++ (if (enableGPU.value) Seq("cuda-redist" -> cudaVersion) else Seq()),
) ++ (if (enableGPU.value) Seq("cuda-redist" -> cudaVersion) else Seq())
++ (if (hasMKL) Seq("mkl" -> mklVersion) else Seq()),
javaCppPlatform := org.bytedeco.sbt.javacpp.Platform.current,
fork := true,
Test / fork := true,
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.0
sbt.version=1.9.8

0 comments on commit c2f2f70

Please sign in to comment.