Skip to content

Question: speed #47

Description

@kalle07

i tried to keep all same in my python code as in lm-studio settings

    if model_type == "gguf":
        print(f"System: {system_content}\n")
        print(f"User: {user_content}\n")
        print(f"Assistant _GGUF_ with seed:{seed}:\n", file=sys.stderr)

        llm = Llama(
            model_path=gguf_model_path,
            n_ctx=12000,
            n_threads=os.cpu_count() or 8,
            n_gpu_layers=-1 if torch.cuda.is_available() else 0,
            use_mmap=False,
            use_mlock=False,
            flash_attn=True,
            seed=seed,
            verbose=False,
            n_mlx_experts=10,
            offload_kqv=True,
        )

        max_tokens = int(summary_word_limit * 2.4)

        # ---------------- Streaming with batching ----------------
        flush_every_tokens = 5

        token_buffer = ""
        buffer_token_count = 0

        output = ""
        generated_tokens = 0

        gen_start = time.perf_counter()

        for chunk in llm(
            chat_prompt,
            max_tokens=max_tokens,
            temperature=0.1,
            top_p=0.95,
            top_k=40,
            repeat_penalty=1.1,
            min_p=0.05,
            stream=True,
        ):

and i also see it directly becasue the difference is large
30token/s the python with your latest llama.cpp (https://github.com/JamePeng/llama-cpp-python/releases/download/v0.3.20-cu126-Basic-win-20260104/llama_cpp_python-0.3.20-cp312-cp312-win_amd64.whl)
38token/s lm-studio (cuda12.cpp)
34token/s lm-studio (cuda.cpp)

what is your impression, you do make such test?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions