Skip to content

Extract simplego backend into standalone module#1

Open
ajroetker wants to merge 1 commit intogomlx:mainfrom
ajroetker:extract-simplego-backend
Open

Extract simplego backend into standalone module#1
ajroetker wants to merge 1 commit intogomlx:mainfrom
ajroetker:extract-simplego-backend

Conversation

@ajroetker
Copy link
Collaborator

Summary

  • Extracts the simplego backend from gomlx/gomlx and go-highway contrib packages from ajroetker/go-highway into a standalone github.com/gomlx/backend module
  • Inlines the highway SIMD bridge directly into the simplego package, removing the interface/registration indirection (HighwayMatMul interface, RegisterHighway(), side-effect import pattern)
  • Consolidates two worker pool implementations (internal/workerspool mutex-based pool and pkg/workerpool channel-based pool) into a single pkg/workerpool package
  • Adds go tool directives for hwygen and goat with the ajroetker/goat fork replace

Module layout

gomlx/backend/
├── go.mod              # module github.com/gomlx/backend
├── gomlx/              # simplego backend (package simplego) with inlined highway SIMD
├── pkg/
│   ├── matmul/         # from go-highway contrib/matmul
│   ├── nn/             # from go-highway contrib/nn
│   ├── activation/     # from go-highway contrib/activation
│   ├── packgemm/       # packed GEMM implementation
│   └── workerpool/     # consolidated worker pool
└── internal/
    └── cmd/            # code generators (simplego_generator, simplego_dispatcher,
                        #   alternates_generator, packgemm_generator)

Test plan

  • go build ./... passes
  • go vet ./... passes
  • go test ./gomlx/... passes
  • go test ./pkg/... passes (matmul, nn, activation, packgemm, workerpool)
  • go tool hwygen --help resolves correctly
  • go tool goat --help resolves correctly

Move the simplego backend, go-highway contrib packages, and supporting
code from gomlx/gomlx and ajroetker/go-highway into a standalone
github.com/gomlx/backend module.

Key changes:
- gomlx/: simplego backend (package simplego) with highway SIMD bridge
  inlined directly, removing the interface/registration indirection
- pkg/matmul, pkg/nn, pkg/activation: go-highway contrib packages with
  rewritten inter-package imports
- pkg/workerpool: consolidated worker pool merging the channel-based
  ParallelFor pool and mutex-based ad-hoc goroutine pool into one
- pkg/packgemm: packed GEMM implementation
- internal/cmd/: code generators (simplego_generator, simplego_dispatcher,
  alternates_generator, packgemm_generator)
- Tool directives for hwygen (go-highway code generator) and goat
  (C-to-Go assembly tool) with ajroetker/goat fork replace
- Test tolerances adjusted for always-active highway SIMD path
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.

1 participant

Comments