Compare commits

..

No commits in common. "dc81abbc52c389bfa289ce9ba2eff1fd018109c4" and "0c1fc1a04e3e3f5bdb0821830c7f36ded37c6603" have entirely different histories.

9 changed files with 17 additions and 43 deletions

View File

@ -92,7 +92,7 @@ jobs:
submodules: true
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -yq libboost-dev libasio-dev libboost-thread-dev
run: sudo apt-get update && sudo apt-get install -yq libboost-dev libasio-dev
- name: Install OpenBlas
if: ${{ matrix.build == 'avx2-openblas' }}
@ -207,7 +207,6 @@ jobs:
$msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
$lib = $(join-path $msvc 'bin\Hostx64\x64\lib.exe')
& $lib /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll
- name: Build
id: cmake_build
env:
@ -215,7 +214,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. ${{ matrix.defines }} -DBoost_LIBRARYDIRS=${{ steps.install-boost.outputs.BOOST_ROOT }}/lib
cmake .. ${{ matrix.defines }}
cmake --build . --config Release --target turbopilot
# - name: Add libopenblas.dll

View File

@ -1,15 +1,5 @@
cmake_minimum_required (VERSION 3.0)
project(turbopilot VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED true)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED true)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
# option(BUILD_SHARED_LIBS "Build using shared libraries" OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS "on")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
@ -37,9 +27,6 @@ if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES
endif()
add_subdirectory(extern/ggml)
add_subdirectory(extern/argparse)
add_subdirectory(extern/spdlog)
@ -48,13 +35,10 @@ if (GGML_STATIC)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
SET(BUILD_SHARED_LIBS OFF)
SET(CMAKE_EXE_LINKER_FLAGS "-static")
# if(GGML_OPENBLAS)
# set(BLA_STATIC ON)
# endif()
endif()
add_subdirectory(src)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

View File

@ -7,7 +7,7 @@ RUN apt-get update && apt-get install ca-certificates gpg wget
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
RUN apt-get update && apt-get install -y build-essential cmake libboost-dev libboost-thread-dev
RUN apt-get update && apt-get install -y build-essential cmake libboost-dev
ADD ./ /turbopilot

View File

@ -7,7 +7,7 @@ RUN apt-get update && apt-get install ca-certificates gpg wget
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
RUN apt-get update && apt-get install -y build-essential cmake libboost-dev libboost-thread-dev
RUN apt-get update && apt-get install -y build-essential cmake libboost-dev
ADD ./ /turbopilot

View File

@ -1,6 +1,6 @@
FROM alpine AS build
RUN apk add --update alpine-sdk boost-dev cmake asio-dev
RUN apk add --update alpine-sdk boost-dev cmake asio-dev
ADD ./ /turbopilot/

View File

@ -6,9 +6,9 @@
| Model Name | RAM Requirement | Direct Download | HF Project Link |
|---------------------|-----------------|-----------------|-----------------|
| StableCode | ~3GiB | [:arrow_down:](https://huggingface.co/TheBloke/stablecode-instruct-alpha-3b-GGML/blob/main/stablecode-instruct-alpha-3b.ggmlv1.q4_0.bin) | [:hugs:](https://huggingface.co/TheBloke/stablecode-instruct-alpha-3b-GGML/) |
| StarCoder | ~3GiB | [:arrow_down:](https://huggingface.co/TheBloke/stablecode-instruct-alpha-3b-GGML/blob/main/stablecode-instruct-alpha-3b.ggmlv1.q4_0.bin) | [:hugs:](https://huggingface.co/TheBloke/stablecode-instruct-alpha-3b-GGML/) |
To run in Turbopilot set model type `-m stablecode`
## "Coder" family models
@ -23,7 +23,7 @@ This model is primarily trained on Python, Java and Javscript.
| Model Name | RAM Requirement | Direct Download | HF Project Link |
|---------------------|-----------------|-----------------|-----------------|
| SantaCoder | ~2GiB | [:arrow_down:](https://huggingface.co/mike-ravkine/gpt_bigcode-santacoder-GGML/resolve/main/santacoder-q4_0.bin) | [:hugs:](https://huggingface.co/mike-ravkine/gpt_bigcode-santacoder-GGML/) |
| StarCoder | ~2GiB | [:arrow_down:](https://huggingface.co/mike-ravkine/gpt_bigcode-santacoder-GGML/resolve/main/santacoder-q4_0.bin) | [:hugs:](https://huggingface.co/mike-ravkine/gpt_bigcode-santacoder-GGML/) |
To run in Turbopilot set model type `-m starcoder`
@ -39,7 +39,7 @@ Even when quantized, WizardCoder is a large model that takes up a significant am
|---------------------|-----------------|-----------------|-----------------|
| WizardCoder | ~12GiB | [:arrow_down:](https://huggingface.co/TheBloke/WizardCoder-15B-1.0-GGML/resolve/main/WizardCoder-15B-1.0.ggmlv3.q4_0.bin) | [:hugs:](https://huggingface.co/TheBloke/WizardCoder-15B-1.0-GGML/) |
To run in Turbopilot set model type `-m wizardcoder`
To run in Turbopilot set model type `-m starcoder`
### StarCoder (Released 4/5/2023)

View File

@ -7,7 +7,7 @@
#include <map>
#include <vector>
#include <random>
#include <mutex>
#include <boost/thread.hpp>
typedef void (*offload_func_t)(struct ggml_tensor * tensor);
void ggml_nop(struct ggml_tensor * tensor);
@ -64,7 +64,7 @@ protected:
virtual std::stringstream predict_impl(std::string prompt, int max_length, bool include_prompt) = 0;
ModelConfig config;
std::mt19937 &rng;
std::mutex model_lock;
boost::mutex model_lock;
};
#endif //__TURBOPILOT_MODEL_H

View File

@ -1,7 +1,6 @@
set(TURBOPILOT_TARGET turbopilot)
find_package(Boost COMPONENTS thread system REQUIRED)
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(${TURBOPILOT_TARGET}
@ -17,9 +16,6 @@ add_executable(${TURBOPILOT_TARGET}
../include/turbopilot/starcoder.hpp
)
#set(THREADS_PREFER_PTHREAD_FLAG TRUE)
#find_package(Threads REQUIRED)
target_include_directories(${TURBOPILOT_TARGET} PRIVATE
../include
@ -27,6 +23,8 @@ target_include_directories(${TURBOPILOT_TARGET} PRIVATE
../extern/crow/include
)
#target_compile_features(${TURBOPILOT_TARGET} PRIVATE cxx_std_11)
target_link_libraries(${TURBOPILOT_TARGET} PRIVATE ggml argparse)
target_link_libraries(${TURBOPILOT_TARGET} PRIVATE ggml argparse)
#target_link_libraries(${TURBOPILOT_TARGET} PRIVATE spdlog::spdlog_header_only)

View File

@ -60,11 +60,6 @@ int main(int argc, char **argv)
.default_value(0.1f)
.scan<'g', float>();
program.add_argument("-b", "--batch-size")
.help("set batch size for model completion")
.default_value(512)
.scan<'i',int>();
program.add_argument("prompt").remaining();
@ -101,7 +96,6 @@ int main(int argc, char **argv)
config.n_threads = program.get<int>("--threads");
config.temp = program.get<float>("--temperature");
config.top_p = program.get<float>("--top-p");
config.n_batch = program.get<int>("--batch-size");
if(model_type.compare("codegen") == 0) {
spdlog::info("Initializing GPT-J type model for '{}' model", model_type);
@ -142,7 +136,6 @@ int main(int argc, char **argv)
return "Hello world";
});
CROW_ROUTE(app, "/copilot_internal/v2/token")([](){
//return "Hello world";