Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Missing cgroup awareness

Đang mở
#6,059 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, kubernetes, linux

Hướng nghiên cứu

Start with the code that determines the value returned by openblas_get_num_threads(), then reproduce the issue with the provided systemd-run CPUQuota command. Compare the needed cgroup parsing with the referenced num_cpus Linux implementation and decide which cgroup versions are in scope. Done means a quota-limited container reports its available CPU count rather than the physical count.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

There are a variety of ways cgroups can restrict CPU availability, and OpenBLAS does not know about all of them.

Without knowing about these restrictions, the result can be code running in a container (e.g. Kubernetes pod) thinking it has far more cores than it actually does, since it will choose the physical CPU count instead of the restricted access the container has been given. This can cause oversaturation and slowness.

To try this out, you can run a program that checks openblas_get_num_threads() under a container created with systemd-run:

systemd-run --user --scope --property CPUQuota="200%" -- yourprogram --yourarg=yourvalue

The program should only have 2 cores, but will in fact report the number of physical cores on the CPU instead.

You can see logic for cgroups parsing (it's on the filesystem) in https://github.com/seanmonstar/num_cpus/blob/master/src/linux.rs for example.

(Not sure if cgroups v1 is worth supporting at this point, since it's old.)

(I validated this with the threadpoolctl Python library.)

Ngôn ngữ chính
C
Star
7.6k
Fork
1.7k
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
57

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của OpenMathLib/OpenBLAS

Tất cả issue của OpenMathLib/OpenBLAS

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.