Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 10 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ name: CI

on:
push:
branches:
- "**"
pull_request:
branches:
- "**"

permissions:
contents: read
Expand All @@ -16,43 +12,13 @@ concurrency:
cancel-in-progress: true

jobs:
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]

env:
BUILD_TYPE: Release
BUILD_DIR: build
GENERATOR: Ninja
CCACHE_DIR: ~/.ccache

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
./scripts/deps.sh

- name: Restore ccache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ccache-${{ runner.os }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
ccache-${{ runner.os }}-${{ github.ref_name }}-
ccache-${{ runner.os }}-

- name: Show ccache stats (before)
run: ccache -s || true

- name: Build + Test
run: make test

- name: Show ccache stats (after)
run: ccache -s || true
build:
uses: vivarium-ai/certifiable-github/.github/workflows/ci.yml@master
with:
build-target: certifiable-inference

tt-build:
uses: vivarium-ai/certifiable-github/.github/workflows/tt-ci.yml@master
with:
build-target: certifiable-inference
tt_dev_image: ghcr.io/tenstorrent/tt-metal/tt-metalium/ubuntu-22.04-dev-amd64:d6958801d86fe1e20a07f2be7795fac0b2c9b211
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Build artifacts
build/
/build-*/
/build_*/
/build/bootstrap/
/.bdep/
.bpkg/

**/*.config.build
**/*.config.build.save

*.o
*.a
*.so
Expand All @@ -21,6 +29,20 @@ Thumbs.db
tests/static/*.txt
tests/benchmarks/results/

# Build2 symlinks exes from build dir to src dir for convenient
examples/debug_conv
examples/debug_pool
examples/edge_detection
examples/xor_gate
tests/benchmarks/test_timing_consistency
tests/unit/test_activations
tests/unit/test_convolution
tests/unit/test_fixed_point
tests/unit/test_hash_basic
tests/unit/test_hash_consistency
tests/unit/test_matrix_reproducibility
tests/unit/test_pooling

# Temporary files
*.tmp
*.log
197 changes: 0 additions & 197 deletions CMakeLists.txt

This file was deleted.

57 changes: 29 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,53 @@ export VERSION
export REVISION

# Build configuration (overrideable)
BUILD_DIR ?= build
BUILD_TYPE ?= Release
GENERATOR ?= Ninja
# build2 requires out-of-source builds. Default to parent directory with compiler suffix.
SRCDIR := $(notdir $(CURDIR))
SCRIPTS_DIR ?= ./certifiable-build/scripts
BUILD_DIR ?= ../build2/$(SRCDIR)-default
BUILD_TYPE ?= release
PREFIX ?= /usr/local

CMAKE ?= cmake
CTEST ?= ctest
# Export for scripts
export BUILD_DIR
export BUILD_TYPE
export PREFIX

# ccache (enabled by default if available)
CCACHE ?= ccache
CCACHE_DIR ?= $(HOME)/.ccache
export CCACHE_DIR
.PHONY: all help setup start-tt config build test install package release clean

CMAKE_CACHE_ARGS := \
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
-DCMAKE_C_COMPILER_LAUNCHER=$(CCACHE) \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(CCACHE)

.PHONY: all help deps config build test install release clean

all: test
all: config build test

##@ Dependencies
deps: ## Install project dependencies
./scripts/deps.sh
setup: ## Setup project
$(SCRIPTS_DIR)/setup.sh

##@ Development
config: ## Configure the build
$(CMAKE) -S . -B $(BUILD_DIR) -G "$(GENERATOR)" $(CMAKE_CACHE_ARGS)
$(SCRIPTS_DIR)/config.sh

build: config ## Build the project
$(CMAKE) --build $(BUILD_DIR) --parallel
build: ## Build the project
$(SCRIPTS_DIR)/build.sh

start-tt: ## Start the Tenstorrent container
$(SCRIPTS_DIR)/start-tt.sh

##@ Testing
test: build ## Run tests
$(CTEST) --test-dir $(BUILD_DIR) --output-on-failure
test: ## Run tests
$(SCRIPTS_DIR)/test.sh

##@ Project Management
install: build ## Install the project
$(CMAKE) --install $(BUILD_DIR)
$(SCRIPTS_DIR)/install.sh

package: ## Build release artifacts
$(SCRIPTS_DIR)/package.sh

release: ## Build release artifacts
@echo "Building release..."
release: ## Publish release artifacts
$(SCRIPTS_DIR)/release.sh

##@ Maintenance
clean: ## Remove all build artifacts
rm -rf $(EXES) $(DIST) $(BUILD_DIR)
$(SCRIPTS_DIR)/clean.sh

##@ Documentation
help: ## Display this help
Expand Down
5 changes: 5 additions & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.config.build
*.config.build.save
*.variables.build

.DS_Store
7 changes: 7 additions & 0 deletions build/bootstrap.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
project = certifiable-inference

using version
using config
using test
using dist
using install
Loading
Loading