-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sbt
473 lines (450 loc) · 15.9 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
inThisBuild(
List(
organization := "io.github.pityka",
homepage := Some(url("https://pityka.github.io/lamp/")),
licenses := List(("MIT", url("https://opensource.org/licenses/MIT"))),
developers := List(
Developer(
"pityka",
"Istvan Bartha",
url("https://github.com/pityka/lamp")
)
),
parallelExecution := false
)
)
lazy val commonSettings = Seq(
scalaVersion := "2.13.15",
crossScalaVersions := Seq("2.13.15", "3.3.4"),
Test / parallelExecution := false,
scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) =>
Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-encoding",
"utf-8", // Specify character encoding used by source files.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:postfixOps",
"-language:existentials",
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xfatal-warnings" // Fail the compilation if there are any warnings.
)
case Some((2, _)) =>
Seq(
"-opt:l:method",
"-opt:l:inline",
"-opt-inline-from:org.saddle.**",
"-opt-warnings",
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-encoding",
"utf-8", // Specify character encoding used by source files.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:postfixOps",
"-language:existentials",
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xfatal-warnings", // Fail the compilation if there are any warnings.
"-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver.
"-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error.
"-Xlint:delayedinit-select", // Selecting member of DelayedInit.
"-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element.
"-Xlint:inaccessible", // Warn about inaccessible types in method signatures.
"-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`.
"-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id.
"-Xlint:nullary-unit", // Warn when nullary methods return Unit.
"-Xlint:option-implicit", // Option.apply used implicit view.
"-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds.
"-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field.
"-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component.
"-Xlint:type-parameter-shadow", // A local type parameter shadows a type already in scope.
// "-Ywarn-dead-code", // Warn when dead code is identified.
// "-Ywarn-numeric-widen", // Warn when numerics are widened.
"-Ywarn-unused:implicits", // Warn if an implicit parameter is unused.
"-Ywarn-unused:imports", // Warn if an import selector is not referenced.
"-Ywarn-unused:locals", // Warn if a local definition is unused.
"-Ywarn-unused:params", // Warn if a value parameter is unused.
"-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused.
"-Ywarn-unused:privates" // Warn if a private member is unused.
)
case _ => ???
}),
Compile / console / scalacOptions ~= (_ filterNot (_ == "-Xfatal-warnings")),
Compile / doc / scalacOptions ~= (_ filterNot (_ == "-Xfatal-warnings"))
) ++ Seq(
fork := true,
run / javaOptions += "-Xmx12G",
cancelable in Global := true
)
lazy val Cuda = config("cuda").extend(Test)
lazy val AllTest = config("alltest").extend(Test)
val saddleVersion = "4.0.0-M11"
val upickleVersion = "3.1.4"
val scalaTestVersion = "3.2.18"
val scribeVersion = "3.12.2"
val catsEffectVersion = "3.5.7"
val catsCoreVersion = "2.10.0"
val jsoniterscalaVersion = "2.27.5"
lazy val saddlecompat = project
.in(file("lamp-saddle"))
.settings(commonSettings: _*)
.settings(
name := "lamp-saddle",
libraryDependencies ++= Seq(
"io.github.pityka" %% "saddle-core" % saddleVersion,
"io.github.pityka" %% "saddle-linalg" % saddleVersion % "test",
"org.scalatest" %% "scalatest" % scalaTestVersion % "test"
)
)
.dependsOn(sten)
lazy val akkacommunicator = project
.in(file("lamp-akka"))
.settings(commonSettings: _*)
.settings(
name := "lamp-akka",
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.6.20" % Provided,
"com.typesafe.akka" %% "akka-remote" % "2.6.20" % Provided,
"org.scalatest" %% "scalatest" % scalaTestVersion % "test"
)
)
.dependsOn(data % "compile->compile;test->test")
lazy val sten = project
.in(file("lamp-sten"))
.configs(Cuda)
.configs(AllTest)
.settings(commonSettings: _*)
.settings(
name := "lamp-sten",
libraryDependencies ++= Seq(
"io.github.pityka" %% "aten-scala-core" % "0.0.0+119-7231a9c7",
"org.typelevel" %% "cats-core" % catsCoreVersion,
"org.typelevel" %% "cats-effect" % catsEffectVersion,
"org.scalatest" %% "scalatest" % scalaTestVersion % "test"
),
inConfig(Cuda)(Defaults.testTasks),
inConfig(AllTest)(Defaults.testTasks),
Test / testOptions += Tests.Argument("-l", "cuda slow"),
Cuda / testOptions := List(Tests.Argument("-n", "cuda")),
AllTest / testOptions := Nil
)
lazy val core = project
.in(file("lamp-core"))
.configs(Cuda)
.configs(AllTest)
.settings(commonSettings: _*)
.settings(
name := "lamp-core",
inConfig(Cuda)(Defaults.testTasks),
inConfig(AllTest)(Defaults.testTasks),
Test / testOptions += Tests.Argument("-l", "cuda slow"),
Cuda / testOptions := List(Tests.Argument("-n", "cuda")),
AllTest / testOptions := Nil,
libraryDependencies ++= List(
"io.github.pityka" %% "saddle-linalg" % saddleVersion % "test"
)
)
.dependsOn(sten % "test->test;compile->compile", saddlecompat % "test->test")
lazy val data = project
.in(file("lamp-data"))
.configs(Cuda)
.configs(AllTest)
.settings(commonSettings: _*)
.settings(
name := "lamp-data",
libraryDependencies ++= Seq(
"com.outr" %% "scribe" % scribeVersion,
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % jsoniterscalaVersion,
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterscalaVersion % "compile-internal"
),
inConfig(Cuda)(Defaults.testTasks),
inConfig(AllTest)(Defaults.testTasks),
Test / testOptions += Tests.Argument("-l", "cuda slow"),
Cuda / testOptions := List(Tests.Argument("-n", "cuda")),
AllTest / testOptions := Nil
)
.dependsOn(core % "test->test;compile->compile", onnx % "test")
lazy val e2etest = project
.in(file("endtoendtest"))
.configs(Cuda)
.configs(AllTest)
.settings(commonSettings: _*)
.settings(
name := "lamp-e2etest",
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % scalaTestVersion % "test"
),
publish / skip := true,
publishArtifact := false,
inConfig(Cuda)(Defaults.testTasks),
inConfig(AllTest)(Defaults.testTasks),
Test / testOptions += Tests.Argument("-l", "cuda slow"),
Cuda / testOptions := List(Tests.Argument("-n", "cuda")),
AllTest / testOptions := Nil
)
.dependsOn(data)
.dependsOn(forest, saddlecompat)
.dependsOn(core % "test->test;compile->compile")
lazy val safetensors = project
.in(file("lamp-safetensors"))
.settings(commonSettings: _*)
.settings(
name := "lamp-safetensors",
libraryDependencies ++= Seq(
"me.vican.jorge" %% "dijon" % "0.6.0"
)
)
.dependsOn(data)
.dependsOn(core % "test->test;compile->compile", saddlecompat)
lazy val umap = project
.in(file("lamp-umap"))
.configs(Cuda)
.configs(AllTest)
.settings(commonSettings: _*)
.settings(
name := "lamp-umap",
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % scalaTestVersion % "test"
),
inConfig(Cuda)(Defaults.testTasks),
inConfig(AllTest)(Defaults.testTasks),
Test / testOptions += Tests.Argument("-l", "cuda slow"),
Cuda / testOptions := List(Tests.Argument("-n", "cuda")),
AllTest / testOptions := Nil
)
.dependsOn(data, knn, saddlecompat % "test")
.dependsOn(core % "test->test;compile->compile")
lazy val kmeans = project
.in(file("lamp-kmeans"))
.configs(Cuda)
.configs(AllTest)
.settings(commonSettings: _*)
.settings(
name := "lamp-kmeans",
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % scalaTestVersion % "test"
),
inConfig(Cuda)(Defaults.testTasks),
inConfig(AllTest)(Defaults.testTasks),
Test / testOptions += Tests.Argument("-l", "cuda slow"),
Cuda / testOptions := List(Tests.Argument("-n", "cuda")),
AllTest / testOptions := Nil
)
.dependsOn(data, knn, saddlecompat % "test")
.dependsOn(core % "test->test;compile->compile")
lazy val onnx = project
.in(file("lamp-onnx"))
.configs(Cuda)
.configs(AllTest)
.settings(commonSettings: _*)
.settings(
name := "lamp-onnx",
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % scalaTestVersion % "test",
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",
"com.microsoft.onnxruntime" % "onnxruntime" % "1.15.0" % "test"
),
Compile / PB.targets := Seq(
scalapb.gen() -> (Compile / sourceManaged).value / "scalapb"
),
inConfig(Cuda)(Defaults.testTasks),
inConfig(AllTest)(Defaults.testTasks),
Test / testOptions += Tests.Argument("-l", "cuda slow"),
Cuda / testOptions := List(Tests.Argument("-n", "cuda")),
AllTest / testOptions := Nil
)
.dependsOn(core % "test->test;compile->compile")
lazy val forest = project
.in(file("extratrees"))
.settings(commonSettings: _*)
.settings(
name := "extratrees",
libraryDependencies ++= Seq(
"com.lihaoyi" %% "upickle" % upickleVersion,
"org.scalatest" %% "scalatest" % scalaTestVersion % "test",
"org.typelevel" %% "cats-effect" % catsEffectVersion,
"io.github.pityka" %% "saddle-core" % saddleVersion
)
)
.dependsOn(core % "test->test")
lazy val knn = project
.in(file("lamp-knn"))
.configs(Cuda)
.configs(AllTest)
.settings(commonSettings: _*)
.settings(
name := "lamp-knn",
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % scalaTestVersion % "test",
"io.github.pityka" %% "saddle-linalg" % saddleVersion
),
inConfig(Cuda)(Defaults.testTasks),
inConfig(AllTest)(Defaults.testTasks),
Test / testOptions += Tests.Argument("-l", "cuda slow"),
Cuda / testOptions := List(Tests.Argument("-n", "cuda")),
AllTest / testOptions := Nil
)
.dependsOn(core, saddlecompat)
.dependsOn(core % "test->test;compile->compile")
lazy val example_cifar100 = project
.in(file("example-cifar100"))
.settings(commonSettings: _*)
.settings(
publishArtifact := false,
publish / skip := true,
libraryDependencies ++= Seq(
"com.github.scopt" %% "scopt" % "4.1.0",
"io.github.pityka" %% "saddle-core" % saddleVersion,
"com.outr" %% "scribe" % scribeVersion
)
)
.dependsOn(core, data, onnx, saddlecompat)
.enablePlugins(JavaAppPackaging)
lazy val example_cifar100_distributed = project
.in(file("example-cifar100-distributed"))
.settings(commonSettings: _*)
.settings(
publishArtifact := false,
publish / skip := true,
libraryDependencies ++= Seq(
"com.github.scopt" %% "scopt" % "4.0.1",
"com.typesafe.akka" %% "akka-actor" % "2.6.20",
"com.typesafe.akka" %% "akka-remote" % "2.6.20",
"io.github.pityka" %% "saddle-core" % saddleVersion,
"com.outr" %% "scribe" % scribeVersion
)
)
.dependsOn(core, data, onnx, saddlecompat, akkacommunicator)
.enablePlugins(JavaAppPackaging)
lazy val example_timemachine = project
.in(file("example-timemachine"))
.settings(commonSettings: _*)
.settings(
publishArtifact := false,
publish / skip := true,
libraryDependencies ++= Seq(
"com.github.scopt" %% "scopt" % "4.1.0",
"io.github.pityka" %% "saddle-core" % saddleVersion,
"com.outr" %% "scribe" % scribeVersion
)
)
.dependsOn(core, data, saddlecompat)
lazy val example_bert = project
.in(file("example-bert"))
.settings(commonSettings: _*)
.settings(
publishArtifact := false,
publish / skip := true,
libraryDependencies ++= Seq(
"com.github.scopt" %% "scopt" % "4.1.0",
"io.github.pityka" %% "saddle-core" % saddleVersion,
"com.outr" %% "scribe" % scribeVersion
)
)
.dependsOn(core, data, saddlecompat)
lazy val example_autoregressivelm = project
.in(file("example-autoregressivelm"))
.settings(commonSettings: _*)
.settings(
publishArtifact := false,
publish / skip := true,
libraryDependencies ++= Seq(
"com.github.scopt" %% "scopt" % "4.1.0",
"com.typesafe.akka" %% "akka-actor" % "2.6.20",
"com.typesafe.akka" %% "akka-remote" % "2.6.20",
"io.github.pityka" %% "saddle-core" % saddleVersion,
"com.outr" %% "scribe" % scribeVersion
)
)
.dependsOn(core, data, saddlecompat, akkacommunicator)
.enablePlugins(JavaAppPackaging)
lazy val experiment_recursivelm = project
.in(file("experiment-recursive-lm"))
.settings(commonSettings: _*)
.settings(
publishArtifact := false,
publish / skip := true,
publishArtifact in (Compile, packageDoc) := false,
publishArtifact in packageDoc := false,
sources in (Compile, doc) := Seq.empty,
libraryDependencies ++= Seq(
"com.github.scopt" %% "scopt" % "4.1.0",
"io.github.pityka" %% "saddle-core" % saddleVersion,
"com.outr" %% "scribe" % scribeVersion,
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterscalaVersion % "compile-internal"
)
)
.dependsOn(core, data, saddlecompat)
.enablePlugins(JavaAppPackaging)
lazy val example_arxiv = project
.in(file("example-arxiv"))
.settings(commonSettings: _*)
.settings(
publishArtifact := false,
publish / skip := true,
libraryDependencies ++= Seq(
"com.github.scopt" %% "scopt" % "4.1.0",
"com.outr" %% "scribe" % scribeVersion,
"io.github.pityka" %% "saddle-binary" % saddleVersion,
"io.github.pityka" %% "saddle-core" % saddleVersion,
"com.lihaoyi" %% "requests" % "0.8.3",
"com.lihaoyi" %% "os-lib" % "0.10.2"
)
)
.dependsOn(core, data, saddlecompat)
lazy val docs = project
.in(file("lamp-docs"))
.dependsOn(
core % "compile->test;compile->compile",
data,
forest,
saddlecompat
)
.settings(commonSettings: _*)
.settings(
publishArtifact := false,
moduleName := "lamp-docs",
mdocVariables := Map(
"VERSION" -> version.value
),
ScalaUnidoc / unidoc / target := (LocalRootProject / baseDirectory).value / "website" / "static" / "api",
cleanFiles += (ScalaUnidoc / unidoc / target).value,
ScalaUnidoc / unidoc / unidocProjectFilter :=
(inAnyProject -- inProjects(
example_arxiv,
example_bert,
example_autoregressivelm,
experiment_recursivelm,
example_cifar100,
example_cifar100_distributed,
example_timemachine,
e2etest,
safetensors
))
)
.enablePlugins(MdocPlugin, ScalaUnidocPlugin)
lazy val root = project
.in(file("."))
.settings(
crossScalaVersions := Nil,
publishArtifact := false,
publish / skip := true
)
.aggregate(
sten,
saddlecompat,
akkacommunicator,
core,
data,
knn,
forest,
umap,
kmeans,
onnx,
docs,
example_cifar100,
example_cifar100_distributed,
example_timemachine,
example_arxiv,
example_bert,
e2etest
)