Skip to content

Drop vestigial cpu dep from skainet-compile-hlo jvmMain (#472)#474

Merged
michalharakal merged 1 commit intodevelopfrom
feature/472-compile-hlo-drop-cpu-dep
Apr 13, 2026
Merged

Drop vestigial cpu dep from skainet-compile-hlo jvmMain (#472)#474
michalharakal merged 1 commit intodevelopfrom
feature/472-compile-hlo-drop-cpu-dep

Conversation

@michalharakal
Copy link
Copy Markdown
Contributor

Closes #472.

Summary

Removes an unused `implementation(project(":skainet-backends:skainet-backend-cpu"))` from `skainet-compile/skainet-compile-hlo/build.gradle.kts`'s `jvmMain.dependencies` block. `HloGenerator` records traces with `VoidTensorOps()` from `skainet-lang-core` and the jvmMain Kotlin sources contain zero imports from `sk.ainet.backend.cpu.*` — the dependency was dead.

Why this is the right first "migration" in the P0-2 track

Grepping every `build.gradle.kts` in the repo for `skainet-backend-cpu` showed that every production-code dependency on the CPU backend is either a test source set (tests actually execute ops), an application runtime, or the BOM — with one exception: `skainet-compile-hlo`'s jvmMain, where the dep was declared but unused. The originally-scoped candidate (`skainet-compile-json`) turned out not to be migratable: its CPU dep is in `jvmTest`, where tests genuinely need a real execution context, and `skainet-backend-api` is interface-only.

So the useful first step in P0-2 isn't "migrate a consumer from CPU to api" — it's removing the one place where CPU is on a production classpath without being referenced. That strictly shrinks the transitive closure of anything pulling in `compile-hlo` and demonstrates that `skainet-lang-core` alone is enough for the production HLO export path.

Test plan

  • `:skainet-compile:skainet-compile-hlo:compileKotlinJvm` green
  • `:skainet-compile:skainet-compile-hlo:jvmTest` green (commonTest still has the CPU dep where tests need it)
  • `:skainet-compile:skainet-compile-hlo:generateHlo` runs cleanly and prints its expected `--model is required` usage message — no `ClassNotFoundException` for `VoidTensorOps` or anything else
  • CI: full multiplatform build

Out of scope

  • Adding `skainet-backend-api` as a replacement dep — the code already only references types from `skainet-lang-core`, so a re-export would be pointless.
  • Migrating the remaining test-source-set consumers off `skainet-backend-cpu`. Those deps are legitimate.
  • Scaffolding a second backend to prove `backend-api` is actually sufficient. That's a better follow-up than another dep swap and should be a separate roadmap item.

🤖 Generated with Claude Code

HloGenerator records traces with VoidTensorOps() from
skainet-lang-core. Its jvmMain sources never import anything
from sk.ainet.backend.cpu.*, and the generateHlo Gradle task
runs cleanly without the CPU backend on its classpath. The
jvmMain dependency on skainet-backends:skainet-backend-cpu
was dead code left over from earlier iterations.

Removing it demonstrates that skainet-lang-core alone is
sufficient for the production HLO export path and reduces
the transitive closure of anything pulling in compile-hlo.
The commonTest dep on backend-cpu stays — tests genuinely
need a real execution context.

Verified:
- :skainet-compile:skainet-compile-hlo:compileKotlinJvm green
- :skainet-compile:skainet-compile-hlo:jvmTest green
- :skainet-compile:skainet-compile-hlo:generateHlo runs and
  prints the expected `--model is required` usage message
  with no classpath errors

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@michalharakal michalharakal merged commit 594527b into develop Apr 13, 2026
4 checks passed
@michalharakal michalharakal deleted the feature/472-compile-hlo-drop-cpu-dep branch April 13, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop vestigial skainet-backend-cpu dep from skainet-compile-hlo jvmMain (P0-2 step 2)

1 participant