Skip to content

Commit

Permalink
Initial backend for ICGPT Labs
Browse files Browse the repository at this point in the history
  • Loading branch information
icppWorld committed Sep 25, 2023
1 parent 47ea5ac commit 78cc678
Show file tree
Hide file tree
Showing 56 changed files with 5,596 additions and 0 deletions.
137 changes: 137 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: false
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 2
UseCRLF: false
UseTab: Never
---

2 changes: 2 additions & 0 deletions .github/trigger.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# A dummy file to trigger the workflow without making any actual change.
# Just change something arbitrary in this line, like a space .
77 changes: 77 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: cicd

on:
workflow_dispatch:
push:
paths:
- "icpp_llama2/**"
- "Makefile"
- ".github/trigger.txt"
- ".github/workflows/cicd.yml"

env:
PYTHON_VERSION: 3.11

jobs:
all:
name: all
runs-on: ubuntu-latest
steps:
# https://github.com/marketplace/actions/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ env.PYTHON_VERSION }}

# -------------------------------------------------------------------
# Checkout icpp-llm
- name: checkout icpp-llm
uses: actions/checkout@v3
with:
fetch-depth: 0
# -------------------------------------------------------------------

- name: install
shell: bash -l {0} # activates the default conda environment ('test')
run: |
echo "Installing tool chains & dependencies"
pwd
sudo apt-get update
sudo apt-get install build-essential
make summary
make install-dfx
make install-python
make install-clang-ubuntu
make install-jp
- name: versions
shell: bash -l {0}
run: |
echo "icpp --version: $(icpp --version)"
echo "clang++ --version: $(clang++ --version)"
echo "g++ --version: $(g++ --version)"
echo "pip version : $(pip --version)"
echo "python version : $(python --version)"
echo "jp version : $(jp --version)"
echo "dfx version : $(dfx --version)"
echo "Ensure conda works properly"
conda info
which pip
which python
which icpp
- name: install-wasi-sdk
shell: bash -l {0}
run: |
echo "Installing wasi-sdk"
icpp install-wasi-sdk
- name: download models
shell: bash -l {0}
run: |
make icpp_llama2_get_stories15M
make icpp_llama2_get_stories260K
- name: all-tests
shell: bash -l {0}
run: |
make all-tests
151 changes: 151 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Misc
x
y
z
paths.txt
.*.swp
.DS_Store
secret

# llama2 models
models
stories260K

# llama2 metrics
etl

# Windows
.vs
CppProperties.json

# Internet Computer
.dfx

# Javascript bindings
declarations

# C++
null.d
*.observed
*.observed.filtered
*.wasm
*.wat
a.out
*.exe
build-native-unit/
build-native/

# PyPI packaging
.pypirc

# Wing IDE
*.wpr
*.wpu

# VS Code
.vscode

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
13 changes: 13 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://mypy.readthedocs.io/en/latest/config_file.html#config-file
# (-) python -m mypy --config-file FILENAME ...

# Global options:
[mypy]
disallow_untyped_calls = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
check_untyped_defs = True
disallow_untyped_decorators = True
show_error_codes = True
warn_redundant_casts = True
warn_unused_ignores = True
Loading

0 comments on commit 78cc678

Please sign in to comment.