Commit Graph

10692 Commits

Author SHA1 Message Date
Brandon Squizzato 0d6fb52be0 Install curl in runtime layer (#8693) 2024-08-04 20:17:16 +02:00
ardfork 978ba3d83d Server: Don't ignore llama.cpp params (#8754)
* Don't ignore llama.cpp params

* Add fallback for max_tokens
2024-08-04 20:16:23 +02:00
Concedo 23caa63f94 up ver 2024-08-04 23:42:22 +08:00
Brian Cunnie ecf6b7f23e batched-bench : handle empty -npl (#8839)
* [example] batched-bench "segmentation fault"

When `llama-batched-bench` is invoked _without_ setting `-npl`, "number
of parallel prompts", it segfaults.

The segfault is caused by invoking `max_element()` on a zero-length
vector, `n_pl`

This commit addresses that by first checking to see if the number of
parallel prompts is zero, and if so sets the maximum sequence size to 1;
otherwise, sets it to the original, the result of `max_element()`.

Fixes, when running `lldb build/bin/llama-batched-bench -- -m models/Meta-Llama-3-8B.gguf`

```
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x000000010000366c llama-batched-bench`main(argc=3, argv=0x000000016fdff268) at batched-bench.cpp:72:28
   69  	    llama_context_params ctx_params = llama_context_params_from_gpt_params(params);
   70
   71  	    // ensure enough sequences are available
-> 72  	    ctx_params.n_seq_max = *std::max_element(n_pl.begin(), n_pl.end());
```

* Update examples/batched-bench/batched-bench.cpp

Co-authored-by: compilade <git@compilade.net>

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Co-authored-by: compilade <git@compilade.net>
2024-08-04 13:55:03 +03:00
Daniel Bevenius 01aae2b497 baby-llama : remove duplicate vector include 2024-08-04 13:24:59 +03:00
henk717 52cc0daa1b Mac builds (#1037)
* OSX attempt 1

* OSX Pyinstaller

* Update kcpp-build-release-osx.yaml

* Update kcpp-build-release-osx.yaml

* Update kcpp-build-release-osx.yaml

* Add .metal file

* Update kcpp-build-release-osx.yaml

* Polish Mac
2024-08-04 11:43:45 +08:00
Concedo bfdf4b021f adjust v4-v6 allocation, default back to localhost 2024-08-04 11:42:16 +08:00
Georgi Gerganov 4b77ea95f5 flake.lock: Update (#8847) 2024-08-03 19:53:20 -07:00
Concedo 40481abf0c allow ipv6 as well 2024-08-04 00:53:19 +08:00
jdomke 76614f352e ggml : reading the runtime sve config of the cpu (#8709)
* ggml : reading the runtime sve config of the cpu

* change to one time init to prevent performance drop

* prefix variable to avoid possible conflicts

* revert xxhash fix and add brackets

---------

Co-authored-by: domke <673751-domke@users.noreply.gitlab.com>
2024-08-03 18:34:41 +02:00
Sigbjørn Skjæret b72c20b85c Fix conversion of unnormalized BF16->BF16 weights (#7843)
* add truncate_bf16

* truncate intermediate fp32 if converting bf16 to bf16

* fix masking in __compute_fp32_to_bf16

* np.int16 no longer used

* missing cast and additional numpy 2.x fix

* ggml-impl : do not flush bf16 subnormals to zero

* ggml : add reference fp32 to bf16 conversion

The fast version is no longer equivalent for all platforms
because of the handling of subnormal values.

* gguf-py : remove flush to zero for bf16 subnormals

* gguf-py : remove float32 truncation to bf16

Rounding achieves the same thing in the cases where this was used.

* missed prototype update in merge

* merge cleanup

---------

Co-authored-by: Francis Couture-Harpin <git@compilade.net>
2024-08-02 15:11:39 -04:00
Concedo 9a0976761e use loopback ip instead of localhost 2024-08-03 00:41:32 +08:00
Concedo 6bf78967f9 more janky nonsense 2024-08-02 21:58:28 +08:00
Mengqing Cao e09a800f9a cann: Fix ggml_cann_im2col for 1D im2col (#8819)
* fix ggml_cann_im2col for 1D im2col

* fix build warning
2024-08-02 16:50:53 +08:00
Concedo 804d3520a9 Merge branch 'upstream' into concedo_experimental
# Conflicts:
#	docs/build.md
#	ggml/src/ggml.c
#	tests/test-backend-ops.cpp
v1.72
2024-08-02 10:44:22 +08:00
Ouadie EL FAROUKI 0fbbd88458 [SYCL] Fixing wrong VDR iq4nl value (#8812) 2024-08-02 08:55:17 +08:00
matteo afbb4c1322 ggml-cuda: Adding support for unified memory (#8035)
* Adding support for unified memory

* adding again the documentation about unified memory

* refactoring: Moved the unified memory code in the correct location.

* Fixed compilation error when using hipblas

* cleaning up the documentation

* Updating the documentation

Co-authored-by: Johannes Gäßler <johannesg@5d6.de>

* adding one more case where the PR should not be enabled

---------

Co-authored-by: matteo serva <matteo.serva@gmail.com>
Co-authored-by: Johannes Gäßler <johannesg@5d6.de>
2024-08-01 23:28:28 +02:00
Alex O'Connell b7a08fd5e0 Build: Only include execinfo.h on linux systems that support it (#8783)
* Only enable backtrace on GLIBC linux systems

* fix missing file from copy

* use glibc macro instead of defining a custom one
2024-08-01 18:53:46 +02:00
slaren 7a11eb3a26 cuda : fix dmmv cols requirement to 2*GGML_CUDA_DMMV_X (#8800)
* cuda : fix dmmv cols requirement to 2*GGML_CUDA_DMMV_X

* update asserts

* only use dmmv for supported types

* add test
2024-08-01 15:26:22 +02:00
Concedo 81bddc2614 Merge branch 'upstream' into concedo_experimental 2024-08-01 20:51:49 +08:00
Concedo 3a72410804 Added vulkan support for SD (+1 squashed commits)
Squashed commits:

[13f42f83] Added vulkan support for SD
2024-08-01 17:12:33 +08:00
Concedo 101efb66af Merge branch 'upstream' into concedo_experimental
# Conflicts:
#	.devops/nix/package.nix
#	CMakeLists.txt
#	Makefile
2024-08-01 10:54:28 +08:00
wangshuai09 c8a0090922 cann: support q8_0 for Ascend backend (#8805) 2024-08-01 10:39:05 +08:00
Igor Okulist afbbcf3c04 server : update llama-server embedding flag documentation (#8779)
Fixes #8763
2024-07-31 19:59:09 -04:00
Clint Herron ed9d2854c9 Build: Fix potential race condition (#8781)
* Fix potential race condition as pointed out by @fairydreaming in #8776

* Reference the .o rather than rebuilding every time.

* Adding in CXXFLAGS and LDFLAGS

* Removing unnecessary linker flags.
2024-07-31 15:51:06 -04:00
pculliton 398ede5efe Adding Gemma 2 2B configs (#8784)
* Adding Gemma 2 2B configs

Updates to Q scaling and Gemma 2 model sizes to match v2 2B model.

* Update src/llama.cpp

Co-authored-by: slaren <slarengh@gmail.com>

---------

Co-authored-by: slaren <slarengh@gmail.com>
2024-07-31 17:12:10 +02:00
Borislav Stanimirov 44d28ddd5c cmake : fix use of external ggml (#8787) 2024-07-31 15:40:08 +02:00
Someone 268c566006 nix: cuda: rely on propagatedBuildInputs (#8772)
Listing individual outputs no longer necessary to reduce the runtime closure size after https://github.com/NixOS/nixpkgs/pull/323056.
2024-07-30 13:35:30 -07:00
Concedo 9a04060aaa also apply even if tensor split is set 2024-07-30 23:01:50 +08:00
Concedo 2f04f848e1 if gpuid is specified, force specific order 2024-07-30 22:58:25 +08:00
Brian 7e72aa74fd py: add_array() will not add to kv store if value is an empty array (#8774)
* gguf_writer.py: add_array() should not add to kv store if empty

* Apply suggestions from code review

I was wondering if there was a specific reason for `if val` but good to hear we can safely use `len(val == 0`

Co-authored-by: compilade <git@compilade.net>

---------

Co-authored-by: compilade <git@compilade.net>
2024-07-31 00:57:03 +10:00
Concedo 7e95b80211 we don't need this 2024-07-30 22:45:41 +08:00
Concedo 265f37f13c Merge branch 'upstream' into concedo_experimental 2024-07-30 22:44:41 +08:00
l3utterfly 7c27a19b2e added android implementation of ggml_print_backtrace_symbols (#8751)
* added android implementation of ggml_print_backtrace_symbols

* Update ggml/src/ggml.c

Co-authored-by: slaren <slarengh@gmail.com>

* Update ggml/src/ggml.c

Co-authored-by: slaren <slarengh@gmail.com>

* Update ggml/src/ggml.c

Co-authored-by: slaren <slarengh@gmail.com>

* Update ggml/src/ggml.c

Co-authored-by: slaren <slarengh@gmail.com>

* Update ggml/src/ggml.c

Co-authored-by: slaren <slarengh@gmail.com>

---------

Co-authored-by: slaren <slarengh@gmail.com>
2024-07-30 16:40:18 +02:00
Concedo bf35652ef7 Merge branch 'upstream' into concedo_experimental
# Conflicts:
#	.github/workflows/build.yml
#	.gitignore
#	flake.lock
#	ggml/CMakeLists.txt
#	ggml/src/CMakeLists.txt
2024-07-30 22:31:49 +08:00
Concedo 43c55bb7e2 hack to fix bad unicode fragments corrupting streamed output 2024-07-30 22:18:22 +08:00
Concedo 1df850c95c add magnum to colab models 2024-07-30 21:13:29 +08:00
Georgi Gerganov 140074bb86 flake.lock: Update (#8729) 2024-07-30 05:58:57 -07:00
wangshuai09 6e2b6000e5 cann: update cmake (#8765) 2024-07-30 12:37:35 +02:00
zhentaoyu c887d8b017 [SYCL] Add TIMESTEP_EMBEDDING OP (#8707)
Signed-off-by: zhentaoyu <zhentao.yu@intel.com>
2024-07-30 14:56:51 +08:00
CarterLi999 75af08c475 ggml: bugfix: fix the inactive elements is agnostic for risc-v vector (#8748)
In these codes, we want to retain the value that they previously held
when mask[i] is false. So we should use undisturbed. With the default
agnostic policy of rvv intrinsic, these values can be held or be
written with 1s.

Co-authored-by: carter.li <carter.li@starfivetech.com>
2024-07-29 18:38:34 +02:00
R0CKSTAR 439b3fc75a cuda : organize vendor-specific headers into vendors directory (#8746)
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
2024-07-29 14:56:12 +02:00
Concedo 102eec3d22 more bugfixes in auto gpu layers selection 2024-07-29 20:38:24 +08:00
Llama 26f1df5e5f Fix the penultimate token sometimes being lost with SSE streaming (#1031)
The token immediately before an eot token was lost when SSE streaming
was enabled if that token was contained entirely within a stop sequence.
As an example of when this could happen, consider this prompt:
  Type the phrase 'pleas' once.
In a Llama 3-derived model, 'pleas' tokenizes as 'ple' 'as'. The token
'as' is contained within this instruct mode stop sequence:
  <|eot_id|><|start_header_id|>assistant<|end_header_id|>
due to the word 'assistant'. Since `string_contains_sequence_substring`
returns True for 'as', this token is added to `tokenReserve` instead of
being streamed immediately. If the '<|eot_id|>' token was generated
next, the text in `tokenReserve` would be discarded.
2024-07-29 20:16:47 +08:00
Concedo 948646ff7a do not offload if auto layers is less than 2, as its usually slower 2024-07-29 20:13:43 +08:00
Concedo e39b8aab8b improvements to auto layer calcs 2024-07-29 18:51:10 +08:00
Meng, Hengyu 0832de7236 [SYCL] add conv support (#8688) 2024-07-29 10:50:27 +08:00
Johannes Gäßler 6eeaeba126 cmake: use 1 more thread for non-ggml in CI (#8740) 2024-07-28 22:32:44 +02:00
Concedo f289fb494a bump size of some payload arr sequences from 16 to 24 2024-07-28 20:29:39 +08:00
Concedo e47477fd4d don't build rope factors from https://github.com/ggerganov/llama.cpp/pull/8676 for CLBlast as it segfaults v1.71.1 2024-07-28 17:27:09 +08:00