Skip to content
Draft
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
19 changes: 19 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This is a good default: files that are auto-detected by git to be text are
# converted to the platform-native line ending (LF on Unix, CRLF on Windows)
# in the working tree and to LF in the repository.
#
* text=auto

# Use `eol=crlf` for files that should have the CRLF line ending both in the
# working tree (even on Unix) and in the repository.
#
#*.bat text eol=crlf

# Use `eol=lf` for files that should have the LF line ending both in the
# working tree (even on Windows) and in the repository.
#
#*.sh text eol=lf

# Use `binary` to make sure certain files are never auto-detected as text.
#
#*.png binary
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
pull_request:

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
uses: vivarium-ai/certifiable-github/.github/workflows/ci.yml@master
with:
build-target: certifiable-training

tt-build:
uses: vivarium-ai/certifiable-github/.github/workflows/tt-ci.yml@master
with:
build-target: certifiable-training
tt_dev_image: ghcr.io/tenstorrent/tt-metal/tt-metalium/ubuntu-22.04-dev-amd64:d6958801d86fe1e20a07f2be7795fac0b2c9b211
45 changes: 42 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
# Build artifacts
build/
.bdep/

# Local default options files.
#
.build2/local/

# Compiler/linker output.
#
*.d
*.t
*.i
*.i.*
*.ii
*.ii.*
*.o
*.a
*.obj
*.gcm
*.pcm
*.ifc
*.so
*.dylib
*.dll
*.a
*.lib
*.exp
*.pdb
*.ilk
*.exe
*.exe.dlls/
*.exe.manifest
*.pc

# Build2 symlinks exes from build dir to src dir for convenient
examples/train_xor
examples/verify_step
tests/unit/test_backward
tests/unit/test_bit_identity
tests/unit/test_compensated
tests/unit/test_forward
tests/unit/test_merkle
tests/unit/test_optimizer
tests/unit/test_permutation
tests/unit/test_primitives
tests/unit/test_prng
tests/unit/test_reduction

# Editor files
*.swp
Expand Down
63 changes: 63 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
EXES :=
DIST :=

# Versioning
VERSION ?= $(shell (git describe --tags 2>/dev/null || echo "develop") | sed 's/^v//')
REVISION ?= $(shell git rev-parse --short HEAD)

export VERSION
export REVISION

# Build configuration (overrideable)
# 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

# Export for scripts
export BUILD_DIR
export BUILD_TYPE
export PREFIX

.PHONY: all help setup start-tt config build test install package release clean

all: config build test

##@ Dependencies
setup: ## Setup project
$(SCRIPTS_DIR)/setup.sh

##@ Development
config: ## Configure the build
$(SCRIPTS_DIR)/config.sh

build: ## Build the project
$(SCRIPTS_DIR)/build.sh

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

##@ Testing
test: ## Run tests
$(SCRIPTS_DIR)/test.sh

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

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

release: ## Publish release artifacts
$(SCRIPTS_DIR)/release.sh

##@ Maintenance
clean: ## Remove all build artifacts
$(SCRIPTS_DIR)/clean.sh

##@ Documentation
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "Makefile Usage:\n make \033[36m<target>\033[0m\n"} /^[.a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

4 changes: 4 additions & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/config.build
/root/
/bootstrap/
build/
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-training

using version
using config
using test
using install
using dist
6 changes: 6 additions & 0 deletions build/export.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$out_root/
{
include include/
}

export $out_root/include/$import.target
11 changes: 11 additions & 0 deletions build/root.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using c
using test

c.std = c99
c.warnings = all
c.coptions += -Werror -pedantic -Wno-unused-parameter

if ($c.id == 'gcc')
c.coptions += -fanalyzer

c.poptions =+ "-I$src_root/include"
14 changes: 14 additions & 0 deletions buildfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
./: {*/ -build/ -certifiable-build/ -include/ -.github/ -docs/} \
doc{README.md} \
legal{LICENSE} \
manifest

./: src/ (examples/) tests/

import src = src/
import examples = examples/
import tests = tests/

# Don't install tests.
#
tests/: install = false
Empty file added certifiable-build/.gitignore
Empty file.
Loading