-
Notifications
You must be signed in to change notification settings - Fork 10k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
llama : move sampling code into llama-sampling
ggml-ci
- Loading branch information
Showing
7 changed files
with
758 additions
and
699 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#pragma once | ||
|
||
#define LLAMA_API_INTERNAL | ||
#include "llama.h" | ||
|
||
#include <array> | ||
#include <set> | ||
#include <map> | ||
#include <cstdint> | ||
#include <random> | ||
|
||
#ifdef __has_include | ||
#if __has_include(<unistd.h>) | ||
#include <unistd.h> | ||
#if defined(_POSIX_MAPPED_FILES) | ||
#include <sys/mman.h> | ||
#include <fcntl.h> | ||
#endif | ||
#if defined(_POSIX_MEMLOCK_RANGE) | ||
#include <sys/resource.h> | ||
#endif | ||
#endif | ||
#endif | ||
|
||
// bump if necessary | ||
#define LLAMA_MAX_NODES 8192 | ||
#define LLAMA_MAX_LAYERS 256 | ||
#define LLAMA_MAX_EXPERTS 160 // DeepSeekV2 | ||
|
||
#ifdef __GNUC__ | ||
#ifdef __MINGW32__ | ||
#define LLAMA_ATTRIBUTE_FORMAT(...) __attribute__((format(gnu_printf, __VA_ARGS__))) | ||
#else | ||
#define LLAMA_ATTRIBUTE_FORMAT(...) __attribute__((format(printf, __VA_ARGS__))) | ||
#endif | ||
#else | ||
#define LLAMA_ATTRIBUTE_FORMAT(...) | ||
#endif | ||
|
||
// | ||
// logging | ||
// | ||
|
||
LLAMA_ATTRIBUTE_FORMAT(2, 3) | ||
void llama_log_internal (ggml_log_level level, const char * format, ...); | ||
void llama_log_callback_default(ggml_log_level level, const char * text, void * user_data); | ||
|
||
#define LLAMA_LOG_INFO(...) llama_log_internal(GGML_LOG_LEVEL_INFO , __VA_ARGS__) | ||
#define LLAMA_LOG_WARN(...) llama_log_internal(GGML_LOG_LEVEL_WARN , __VA_ARGS__) | ||
#define LLAMA_LOG_ERROR(...) llama_log_internal(GGML_LOG_LEVEL_ERROR, __VA_ARGS__) |
Oops, something went wrong.