Skip to content

Unhandled exception: _Xlength_error("string too long") #119

Closed as not planned

Description

@icewm

Use cmake to create the vc++ project ,and debug in vs2022.
python convert-pth-to-ggml.py models/7B/ 1
done.
quantize.exe .\models\7B\ggml-model-f16.bin .\models\7B\ggml-model-q4_0.bin 2
done.
llama -m .\models\7B\ggml-model-q4_0.bin -t 8 -n 128

main: seed = 1678771218
llama_model_load: loading model from '.\models\7B\ggml-model-q4_0.bin' - please wait ...
llama_model_load: n_vocab = 32000
llama_model_load: n_ctx = 512
llama_model_load: n_embd = 4096
llama_model_load: n_mult = 256
llama_model_load: n_head = 32
llama_model_load: n_layer = 32
llama_model_load: n_rot = 128
llama_model_load: f16 = 2
llama_model_load: n_ff = 11008
llama_model_load: n_parts = 1
llama_model_load: ggml ctx size = 4529.34 MB
llama_model_load: memory_size = 512.00 MB, n_mem = 16384
llama_model_load: loading model part 1/1 from '.\models\7B\ggml-model-q4_0.bin'
llama_model_load:

Release file: llama.exe

When i use Debug:

There are "Unhandled exception" in xstring. also in 13B.

Unhandled exception at 0x00007FF8E757051C in llama.exe: Microsoft C++ exception: std::length_error at memory location 0x0000006E15CFCA80.
IN
[[noreturn]] inline void _Xlen_string() {
_Xlength_error("string too long");
}
2023-03-14_134629

Activity

  1. icewm commented on Mar 14, 2023

    @icewm
    Author

    OS: win11 22H2 22621.1265

    models md5 is OK

    length is -858993460

    2023-03-14_173214

  2. j-f1 commented on Mar 14, 2023

    @j-f1
    Contributor

    An int32 can only hold up to 2GB of data so those variables probably need to be int64_t since the model files are >4GB

  3. icewm commented on Mar 14, 2023

    @icewm
    Author

    2023-03-14_215409
    2023-03-14_215238

  4. sw commented on Apr 1, 2023

    @sw
    Contributor

    @icewm : have you modified the model generation to fit your change? reading 8 bytes instead of 4 isn't going to magically work otherwise. I suggest you update to latest master and re-generate your model files. Try to get sha256sum for Windows and check the input files, as per the README. If you still get the error, please post your generated model file sizes and checksums.

  5. icewm commented on Apr 1, 2023

    @icewm
    Author

    I found out that's AVX2 problem.when i use E5-2660V2 will get this error. Change to E5-2660V3 it's OK.

  6. added a commit that references this issue on Aug 2, 2023
  7. added a commit that references this issue on Apr 15, 2026
  8. added a commit that references this issue on Apr 28, 2026
  9. added a commit that references this issue on Jul 26, 2026
  10. added a commit that references this issue on Sep 29, 2026
  11. added a commit that references this issue on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions