Skip to content

Commit

Permalink
add the artifact evaluation for fractaltensor.
Browse files Browse the repository at this point in the history
  • Loading branch information
lcy-seso committed Aug 21, 2024
1 parent 00c1317 commit f2f45e5
Show file tree
Hide file tree
Showing 551 changed files with 53,541 additions and 5 deletions.
17 changes: 17 additions & 0 deletions artifacts/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Run manually to reformat a file:
# clang-format -i --style=file <file>
BasedOnStyle: Google
ColumnLimit: 80
IndentWidth: 4
DerivePointerAlignment: false
SortIncludes: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '<([A-Za-z0-9\Q/-_\E])+>'
Priority: 4
- Regex: '<(catch2|boost)\/'
Priority: 3
- Regex: '<([A-Za-z0-9.\Q/-_\E])+>'
Priority: 2
- Regex: '"([A-Za-z0-9.\Q/-_\E])+"'
Priority: 1
39 changes: 39 additions & 0 deletions artifacts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
build/
*.log
!requirements*.txt
*.tgz
*.gz
*.pyc
.ipynb_checkpoints/
__pycache__/
.vs/
.vscode/
.data/
venv/
.idea/
.checkpoints/
*.pb.h
*.pb.cc
*_pb2.py
tensorboard/
benchmarks/attention/baseline/MultiHeadAttention/log

# generated by compiling tex files.
*.aux
*.bbl
*.blg
*.idx
*.ind
*.lof
*.lot
*.out
*.toc
*.acn
*.acr
*.alg
*.glg
*.glo
*.gls
*.ist
*.fls
*.gv
Empty file added artifacts/.gitmodules
Empty file.
32 changes: 32 additions & 0 deletions artifacts/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
rev: v1.0.1
hooks:
- id: remove-crlf
files: (?!.*third_party)^.*$ | (?!.*book)^.*$
- repo: https://github.com/pre-commit/mirrors-yapf.git
rev: v0.23.0
hooks:
- id: yapf
files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.4.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
files: (?!.*third_party)^.*$ | (?!.*book)^.*$
- id: end-of-file-fixer
- repo: local
hooks:
- id: clang-format-with-version-check
name: clang-format
description: Format files with ClangFormat.
entry: bash ./tools/clang_format.hook -i
language: system
files: \.(c|cc|cxx|cpp|cu|h|cuh|hpp|hxx|proto)$
- repo: https://github.com/iconmaster5326/cmake-format-pre-commit-hook
rev: v0.6.5
hooks:
- id: cmake-format
37 changes: 37 additions & 0 deletions artifacts/FractalTensor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
cmake_minimum_required(VERSION 3.18) # cutlass 3.2 requires cmake 3.18+

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/cmake/Modules/")

set(PYPARSER_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(PYPARSER_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(PYPARSER_PYTHON_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/python/build")

project(kaleido CXX C)
message(STATUS "CXX compiler: ${CMAKE_CXX_COMPILER}, version: "
"${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS "C compiler: ${CMAKE_C_COMPILER}, version: "
"${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")

find_package(Threads REQUIRED)
find_package(CUDA REQUIRED)
find_package(CuDNN REQUIRED)

set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.45.0 COMPONENTS filesystem regex)

if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIR})
add_definitions("-DHAS_BOOST")
else()
message(FATAL_ERROR "Cannot find Boost.")
endif()

include(generic)
include(python)
include(third_party)

add_subdirectory(kaleido/core)
42 changes: 42 additions & 0 deletions artifacts/FractalTensor/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
CUDNN_HOME ?=
BUILD_DIR := build
BENCHMARK_DIR := benchmarks
BENCHMARK_MODEL_CLASS ?= rnn
BENCHMARK_PROJ ?= fractaltensor
BENCHMARK_MODEL ?= stacked_lstm

.PHONY: build clean install-python test-backend test-frontend benchmark benchmarks cpp-format

build:
@mkdir -p $(BUILD_DIR)/
@cd build && cmake ../ -D PYTHON_EXECUTABLE:FILEPATH=`which python3` \
-D CUDNN_INCLUDE_DIR=$(CUDNN_HOME)/include \
-D CUDNN_LIBRARY=$(CUDNN_HOME)/lib/libcudnn.so && make -j$(nproc)

$(BUILD_DIR)/kaleido:
@$(MAKE) build

install-python:
@pip install -r requirements.txt

test-frontend:
@./scripts/tests/frontend_unit_tests.sh
@./scripts/tests/frontend_examples.sh

test-backend: $(BUILD_DIR)/kaleido
@./scripts/tests/backend_unit_tests.sh

benchmark: $(BUILD_DIR)/kaleido
@cd $(BENCHMARK_DIR)/$(BENCHMARK_MODEL_CLASS)/$(BENCHMARK_PROJ)/$(BENCHMARK_MODEL) && \
mkdir -p build && cd build && cmake .. && make -j$(nproc)

benchmarks:
@./scripts/benchmarks/bench.sh

cpp-format:
@./scripts/cpp_format.sh

clean:
@rm -f unittest.log
@rm -rf $(BUILD_DIR)

Loading

0 comments on commit f2f45e5

Please sign in to comment.