OpenMathLib / OpenMathLib/OpenBLAS

2 GB at the start

Open
#5,587 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Support
Dominant language
C
Stars
7.6k
Forks
1.7k
Avg merge
1d 3h
Merged PRs (30d)
42

Description

Just entering the main() in a program linking to "openblas" under MSYS2 consumes 2 GB of RAM.
VMMap shows it as 16 blocks 128 MB each. Are these allocations necessary? Can they be postponed to when I really need something from OpenBLAS?

Image

Setting these variables reduces the memory to 600 MB. It looks like 128 MB is allocated per thread in DLLMain

set OPENBLAS_NUM_THREADS=4
set GOTO_NUM_THREADS=4
set OMP_NUM_THREADS=4

This does not help either:
openblas_set_num_threads(1);

The original issue was against libllama: https://github.com/ggml-org/llama.cpp/issues/18024

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the startup behavior under MSYS2 by entering main() in a program linked to OpenBLAS and inspecting allocations with VMMap. Compare the default thread settings with OPENBLAS_NUM_THREADS, GOTO_NUM_THREADS, OMP_NUM_THREADS, and openblas_set_num_threads(1). Done means determining whether the 128 MB-per-thread DLLMain allocations are necessary or can be deferred.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.