Skip to content

Commit

Permalink
Merge pull request #189 from JetBrains-Research/remove-js-for-core
Browse files Browse the repository at this point in the history
JBAI-5484 [core] Drop JS target for core backend
  • Loading branch information
dmitriyb authored Jul 22, 2024
2 parents ceed8a8 + e115707 commit 384ffca
Show file tree
Hide file tree
Showing 505 changed files with 95 additions and 269 deletions.
8 changes: 2 additions & 6 deletions adapters/kmath/adapter-kmath-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ import io.kinference.gradle.configureTests
group = rootProject.group
version = rootProject.version

repositories {
maven("https://repo.kotlin.link")
}

kotlin {
jvm {
configureTests()
}

sourceSets {
val commonMain by getting {
jvmMain {
dependencies {
api(project(":ndarray:ndarray-api"))
api(project(":ndarray:ndarray-core"))
Expand All @@ -25,7 +21,7 @@ kotlin {
}
}

val commonTest by getting {
jvmTest {
dependencies {
implementation(project(":utils:utils-testing"))
}
Expand Down
15 changes: 3 additions & 12 deletions adapters/kmath/adapter-kmath-ort-gpu/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,24 @@ import io.kinference.gradle.configureGpuTests
group = rootProject.group
version = rootProject.version

repositories {
maven("https://repo.kotlin.link")
}

kotlin {
jvm {
configureGpuTests()
}

sourceSets {
val commonMain by getting {
jvmMain {
dependencies {
api(project(":inference:inference-ort-gpu"))
api(project(":inference:inference-api"))
api(libs.kmath.core)
}
}

val commonTest by getting {
jvmTest {
dependencies {
implementation(project(":utils:utils-testing"))
}
}

val jvmMain by getting {
dependencies {
api(project(":inference:inference-ort-gpu"))
}
}
}
}
15 changes: 3 additions & 12 deletions adapters/kmath/adapter-kmath-ort/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,24 @@ import io.kinference.gradle.configureTests
group = rootProject.group
version = rootProject.version

repositories {
maven("https://repo.kotlin.link")
}

kotlin {
jvm {
configureTests()
}

sourceSets {
val commonMain by getting {
jvmMain {
dependencies {
api(project(":inference:inference-ort"))
api(project(":inference:inference-api"))
api(libs.kmath.core)
}
}

val commonTest by getting {
jvmTest {
dependencies {
implementation(project(":utils:utils-testing"))
}
}

val jvmMain by getting {
dependencies {
api(project(":inference:inference-ort"))
}
}
}
}
9 changes: 2 additions & 7 deletions adapters/multik/adapter-multik-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@ kotlin {
configureTests()
}

js(IR) {
browser()
configureTests()
}

sourceSets {
val commonMain by getting {
jvmMain {
dependencies {
api(project(":ndarray:ndarray-api"))
api(project(":ndarray:ndarray-core"))
Expand All @@ -26,7 +21,7 @@ kotlin {
}
}

val commonTest by getting {
jvmTest {
dependencies {
implementation(project(":utils:utils-testing"))
}
Expand Down
11 changes: 3 additions & 8 deletions adapters/multik/adapter-multik-ort-gpu/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,18 @@ kotlin {
}

sourceSets {
val commonMain by getting {
jvmMain {
dependencies {
api(project(":inference:inference-ort-gpu"))
api(project(":inference:inference-api"))
api(libs.multik.core)
}
}

val commonTest by getting {
jvmTest {
dependencies {
implementation(project(":utils:utils-testing"))
}
}

val jvmMain by getting {
dependencies {
api(project(":inference:inference-ort-gpu"))
}
}
}
}
11 changes: 3 additions & 8 deletions adapters/multik/adapter-multik-ort/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,18 @@ kotlin {
}

sourceSets {
val commonMain by getting {
jvmMain {
dependencies {
api(project(":inference:inference-ort"))
api(project(":inference:inference-api"))
api(libs.multik.core)
}
}

val commonTest by getting {
jvmTest {
dependencies {
implementation(project(":utils:utils-testing"))
}
}

val jvmMain by getting {
dependencies {
api(project(":inference:inference-ort"))
}
}
}
}
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ allprojects {
mavenCentral()
maven(url = "https://packages.jetbrains.team/maven/p/ki/maven")
maven(url = "https://packages.jetbrains.team/maven/p/grazi/grazie-platform-public")
maven("https://repo.kotlin.link")
}

plugins.withType<YarnPlugin>() {
Expand Down
2 changes: 1 addition & 1 deletion inference/inference-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ kotlin {
jvm()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(libs.okio)
api(project(":utils:utils-common"))
Expand Down
12 changes: 2 additions & 10 deletions inference/inference-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,14 @@ plugins {
}

kotlin {
js(IR) {
browser()

configureTests()
configureHeavyTests()
configureBenchmarkTests()
}

jvm {
configureTests()
configureHeavyTests()
configureBenchmarkTests()
}

sourceSets {
val commonMain by getting {
jvmMain {
dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.atomicfu)
Expand All @@ -47,7 +39,7 @@ kotlin {
}


val commonTest by getting {
jvmTest {
dependencies {
implementation(project(":utils:utils-testing"))
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import kotlin.test.Test

class SimultaneousModelsTest {
@Test
fun heavy_test_jvm_simultaneous_bert_electra_models() = TestRunner.runTest(Platform.JVM) {
fun heavy_test_simultaneous_bert_electra_models() = TestRunner.runTest {
val bertDeferred = async {
KIAccuracyRunner.runFromS3("bert:standard:en:v1", errorsVerbose = false)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,10 @@ import kotlin.test.Test

class BERTTest {
@Test
fun heavy_test_jvm_vanilla_bert_model() = TestRunner.runTest(Platform.JVM) {
fun heavy_test_vanilla_bert_model() = TestRunner.runTest {
KIAccuracyRunner.runFromS3("bert:standard:en:v1")
}

@Test
fun heavy_test_js_vanilla_bert_model() = TestRunner.runTest(Platform.JS) {
KIAccuracyRunner.runFromS3("bert:standard:en:v1", disableTests = listOf(
"test_data_set_batch8_seq40"
))
}

@Test
fun benchmark_test_vanilla_bert_performance() = TestRunner.runTest {
KIPerformanceRunner.runFromS3("bert:standard:en:v1", count = 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import kotlin.test.Test

class ElectraTest {
@Test
fun heavy_test_jvm_electra() = TestRunner.runTest(Platform.JVM) {
fun heavy_test_electra() = TestRunner.runTest {
KIAccuracyRunner.runFromS3("bert:electra", errorsVerbose = false)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import kotlin.test.Test

class GECTest {
@Test
fun heavy_test_jvm_gec_model() = TestRunner.runTest(Platform.JVM) {
fun heavy_test_gec_model() = TestRunner.runTest {
KIAccuracyRunner.runFromS3(
"bert:gec:en:standard:v2", disableTests = listOf(
"test_data_set_batch_32_seqLen_32",
Expand All @@ -22,23 +22,6 @@ class GECTest {
)
}

@Test
fun heavy_test_js_gec_model() = TestRunner.runTest(Platform.JS) {
KIAccuracyRunner.runFromS3(
"bert:gec:en:standard:v2", disableTests = listOf(
"test_data_set_batch_32_seqLen_32",
"test_data_set_batch_32_seqLen_64",
"test_data_set_batch_32_seqLen_92",
"test_data_set_batch_32_seqLen_128",
"test_data_set_batch_32_seqLen_256",
"test_data_set_batch_32_seqLen_512",
"test_data_set_batch_1_seqLen_128",
"test_data_set_batch_1_seqLen_256",
"test_data_set_batch_1_seqLen_512"
)
)
}

@Test
fun benchmark_test_gec_performance() = TestRunner.runTest {
KIPerformanceRunner.runFromS3("bert:gec:en:standard:v2", count = 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,10 @@ import kotlin.test.Test

class TreeTRFBiaffineTest {
@Test
fun heavy_test_jvm_tree_trf_biaffine_quantized() = TestRunner.runTest(Platform.JVM) {
fun heavy_test_tree_trf_biaffine_quantized() = TestRunner.runTest {
KITestEngine.KIAccuracyRunner.runFromS3("bert:en_tree:quantized", delta = 3.8)
}

@Test
fun heavy_test_js_tree_trf_biaffine_quantized() = TestRunner.runTest(Platform.JS) {
KITestEngine.KIAccuracyRunner.runFromS3("bert:en_tree:quantized", delta = 3.8, disableTests = listOf(
"test_data_64_4",
"test_data_32_16",
"test_data_32_4",
"test_data_32_3",
))
}

@Test
fun benchmark_test_tree_trf_biaffine_quantized() = TestRunner.runTest {
KITestEngine.KIPerformanceRunner.runFromS3("bert:en_tree:quantized")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import kotlin.test.Test

class GPTFLCCTest {
@Test
fun heavy_test_gpt_py_model_v3() = TestRunner.runTest(Platform.JVM) {
fun heavy_test_gpt_py_model_v3() = TestRunner.runTest {
KIAccuracyRunner.runFromS3("gpt2:flcc-py-completion:standard:v3")
}

@Test
fun heavy_test_gpt_py_model_quantized_v3() = TestRunner.runTest(Platform.JVM) {
fun heavy_test_gpt_py_model_quantized_v3() = TestRunner.runTest {
KIAccuracyRunner.runFromS3("gpt2:flcc-py-completion:quantized:v3", delta = 1.5)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package io.kinference.models.gpt

import io.kinference.KITestEngine.KIAccuracyRunner
import io.kinference.KITestEngine.KIPerformanceRunner
import io.kinference.utils.Platform
import io.kinference.utils.TestRunner
import kotlin.test.Test


class GPTGrazieTest {
@Test
fun heavy_test_gpt_grazie_model() = TestRunner.runTest {
KIAccuracyRunner.runFromS3("gpt2:grazie:distilled:quantized:v6", delta = 5.00)
}

@Test
fun benchmark_test_gpt_grazie_performance() = TestRunner.runTest {
KIPerformanceRunner.runFromS3("gpt2:grazie:distilled:quantized:v6")
}
}
Loading

0 comments on commit 384ffca

Please sign in to comment.