Skip to content

Commit 9f4dde7

Browse files
michalharakalclaude
andcommitted
fix(ci): opt out of AGP config-time-resolution check in project gradle.properties; fix stale Q8_0 test
Real fix for the Build & Test failure (was masked by, then surfaced after, the JS NPM config-time issue): 1. `gradle.properties`: set `android.dependencyResolutionAtConfigurationTime.disallow=false`. AGP's DependencyResolutionChecks fails the build when KGP's KotlinPackageJsonTask resolves the Kotlin/JS + Wasm `*NpmAggregated` configs at configuration time (we have JS npm deps: ktor-client-js, kotlinx-browser) — `assemble`/`allTests` threw `Configuration 'jsNpmAggregated' was resolved during configuration time` (gradle#31483), a false positive against KGP's known behaviour. AGP reads this option ONLY from the project gradle.properties — NOT from `-P` or the CI's ~/.gradle/gradle.properties (which is why the earlier attempts didn't take). Reverted those no-op attempts (build.yml/publish.yml `-P`, ci-gradle.properties). 2. `GemmaQuantLayoutTest`: `pack_non_kquant_returns_null` asserted Q8_0 packs to null, but #179 added Q8_0 packing — it now returns Q8_0BlockTensorData. Replace with `pack_q8_0_produces_block_tensor` + a true-null case (Q4_1). Verified locally: `clean assemble allTests --no-configuration-cache` is GREEN. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 65dc347 commit 9f4dde7

5 files changed

Lines changed: 22 additions & 15 deletions

File tree

.github/ci-gradle.properties

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,3 @@ kotlin.compiler.execution.strategy=daemon
1616

1717
# Disable AAPT2 daemon to prevent "daemon unexpectedly exit" crashes
1818
android.aapt2.daemon=false
19-
20-
# AGP's DependencyResolutionChecks (com.android.build.gradle.internal) fails the
21-
# build when a configuration is resolved at configuration time. KGP's
22-
# KotlinPackageJsonTask resolves the Kotlin/JS + Wasm `*NpmAggregated` configs at
23-
# config time (we DO have JS npm deps: ktor-client-js, kotlinx-browser), so on a
24-
# cold CI build it throws `Configuration 'jsNpmAggregated' was resolved during
25-
# configuration time` (gradle#31483). It's a false positive against KGP's known
26-
# behaviour — the engine repo doesn't hit it only because it has no JS npm deps.
27-
# Opt out of AGP's check so the JS npm resolution proceeds as it does off-CI.
28-
android.dependencyResolutionAtConfigurationTime.disallow=false

.github/workflows/build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ jobs:
4545
./gradlew --no-daemon --stacktrace --info \
4646
-Dorg.gradle.caching=true \
4747
--no-configuration-cache \
48-
-Pandroid.dependencyResolutionAtConfigurationTime.disallow=false \
4948
clean assemble allTests
5049
5150
- name: Build and Test (push)
@@ -57,7 +56,6 @@ jobs:
5756
./gradlew --no-daemon --stacktrace --info \
5857
-Dorg.gradle.caching=true \
5958
--no-configuration-cache \
60-
-Pandroid.dependencyResolutionAtConfigurationTime.disallow=false \
6159
assemble allTests
6260
6361
- name: Memory info (on failure)

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
exit 1
2727
fi
2828
- name: Publish to MavenCentral
29-
run: ./gradlew publish --no-configuration-cache -Pandroid.dependencyResolutionAtConfigurationTime.disallow=false --stacktrace
29+
run: ./gradlew publish --no-configuration-cache --stacktrace
3030
env:
3131
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
3232
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

gradle.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ kotlin.mpp.enableCInteropCommonization=true
3333
#Android
3434
android.useAndroidX=true
3535
android.nonTransitiveRClass=true
36+
# AGP's DependencyResolutionChecks fails the build when a configuration resolves
37+
# at configuration time. KGP's KotlinPackageJsonTask resolves the Kotlin/JS + Wasm
38+
# `*NpmAggregated` configs at config time (we have JS npm deps: ktor-client-js,
39+
# kotlinx-browser), so `assemble`/`allTests` throw `Configuration 'jsNpmAggregated'
40+
# was resolved during configuration time` (gradle#31483) — a false positive against
41+
# KGP's known behaviour. Downgrade AGP's check from fail to warn. NOTE: AGP reads
42+
# this option only from the project gradle.properties — NOT from -P or the CI's
43+
# ~/.gradle/gradle.properties.
44+
android.dependencyResolutionAtConfigurationTime.disallow=false
3645

3746
kotlin.mpp.stability.nowarn=true
3847

llm-inference/gemma/src/commonTest/kotlin/sk/ainet/models/gemma/GemmaQuantLayoutTest.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import sk.ainet.context.DirectCpuExecutionContext
88
import sk.ainet.io.gguf.GGMLQuantizationType
99
import sk.ainet.lang.tensor.Shape
1010
import sk.ainet.lang.tensor.data.Q5_KBlockTensorData
11+
import sk.ainet.lang.tensor.data.Q8_0BlockTensorData
1112
import sk.ainet.lang.types.FP32
1213
import sk.ainet.lang.types.Int8
1314

@@ -55,8 +56,17 @@ class GemmaQuantLayoutTest {
5556
}
5657

5758
@Test
58-
fun pack_non_kquant_returns_null() {
59-
assertNull(packGemmaKQuant<FP32>(ByteArray(34), GGMLQuantizationType.Q8_0, Shape(1, 32)))
59+
fun pack_q8_0_produces_block_tensor() {
60+
// Q8_0 is now packed (32 elems / 34 B per block) so a tied Q8_0 lm_head
61+
// stays packed and runs on the Q8_0 kernel instead of dequanting to FP32.
62+
val td = packGemmaKQuant<FP32>(ByteArray(34), GGMLQuantizationType.Q8_0, Shape(1, 32))
63+
assertTrue(td is Q8_0BlockTensorData, "Q8_0 should pack to Q8_0BlockTensorData")
64+
}
65+
66+
@Test
67+
fun pack_unsupported_quant_returns_null() {
68+
// A quant type with no packed kernel (e.g. Q4_1) falls back to FP32 dequant.
69+
assertNull(packGemmaKQuant<FP32>(ByteArray(20), GGMLQuantizationType.Q4_1, Shape(1, 32)))
6070
}
6171

6272
@Test

0 commit comments

Comments
 (0)