test_command_line_command_flag and test_command_line_import_flag: Different num_threads values
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- python
- Bereich
- testing-qa
Rechercherichtung
Start with test_command_line_command_flag and test_command_line_import_flag in tests/test_threadpoolctl.py, where the reported assertions compare command-line output with threadpool_info(). Check how the tests and command-line subprocess set or inherit thread counts, then determine whether the differing num_threads values indicate a code issue or an overly strict expectation. Done means the behavior is understood and the tests correctly reflect it.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Hello.
We are currently trying to rebuild this package in Fedora for Python 3.11, but we see some suspicious test failures that occur with Python 3.11 as well as with Python 3.10.
The failures look like this:
On i686:
________________________ test_command_line_command_flag ________________________
def test_command_line_command_flag():
pytest.importorskip("numpy")
output = subprocess.check_output(
[sys.executable, "-m", "threadpoolctl", "-c", "import numpy"]
)
cli_info = json.loads(output.decode("utf-8"))
this_process_info = threadpool_info()
for lib_info in cli_info:
> assert lib_info in this_process_info
E AssertionError: assert {'filepath': '/usr/lib/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 6, 'prefix': 'libgomp', ...} in [{'architecture': 'Nehalem', 'filepath': '/usr/lib/libopenblaso-r0.3.20.so', 'internal_api': 'openblas', 'num_threads': 30, ...}, {'filepath': '/usr/lib/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 30, 'prefix': 'libgomp', ...}]
tests/test_threadpoolctl.py:547: AssertionError
________________________ test_command_line_import_flag _________________________
@pytest.mark.skipif(
sys.version_info < (3, 7), reason="need recent subprocess.run options"
)
def test_command_line_import_flag():
result = subprocess.run(
[
sys.executable,
"-m",
"threadpoolctl",
"-i",
"numpy",
"scipy.linalg",
"invalid_package",
"numpy.invalid_sumodule",
],
capture_output=True,
check=True,
encoding="utf-8",
)
cli_info = json.loads(result.stdout)
this_process_info = threadpool_info()
for lib_info in cli_info:
> assert lib_info in this_process_info
E AssertionError: assert {'filepath': '/usr/lib/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 6, 'prefix': 'libgomp', ...} in [{'architecture': 'Nehalem', 'filepath': '/usr/lib/libopenblaso-r0.3.20.so', 'internal_api': 'openblas', 'num_threads': 30, ...}, {'filepath': '/usr/lib/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 30, 'prefix': 'libgomp', ...}]
tests/test_threadpoolctl.py:573: AssertionError
On x86_64
________________________ test_command_line_command_flag ________________________
def test_command_line_command_flag():
pytest.importorskip("numpy")
output = subprocess.check_output(
[sys.executable, "-m", "threadpoolctl", "-c", "import numpy"]
)
cli_info = json.loads(output.decode("utf-8"))
this_process_info = threadpool_info()
for lib_info in cli_info:
> assert lib_info in this_process_info
E AssertionError: assert {'filepath': '/usr/lib64/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 6, 'prefix': 'libgomp', ...} in [{'architecture': 'SkylakeX', 'filepath': '/usr/lib64/libopenblaso-r0.3.20.so', 'internal_api': 'openblas', 'num_threads': 30, ...}, {'filepath': '/usr/lib64/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 30, 'prefix': 'libgomp', ...}]
tests/test_threadpoolctl.py:547: AssertionError
________________________ test_command_line_import_flag _________________________
@pytest.mark.skipif(
sys.version_info < (3, 7), reason="need recent subprocess.run options"
)
def test_command_line_import_flag():
result = subprocess.run(
[
sys.executable,
"-m",
"threadpoolctl",
"-i",
"numpy",
"scipy.linalg",
"invalid_package",
"numpy.invalid_sumodule",
],
capture_output=True,
check=True,
encoding="utf-8",
)
cli_info = json.loads(result.stdout)
this_process_info = threadpool_info()
for lib_info in cli_info:
> assert lib_info in this_process_info
E AssertionError: assert {'filepath': '/usr/lib64/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 6, 'prefix': 'libgomp', ...} in [{'architecture': 'SkylakeX', 'filepath': '/usr/lib64/libopenblaso-r0.3.20.so', 'internal_api': 'openblas', 'num_threads': 30, ...}, {'filepath': '/usr/lib64/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 30, 'prefix': 'libgomp', ...}]
tests/test_threadpoolctl.py:573: AssertionError
On ppc64le
________________________ test_command_line_command_flag ________________________
def test_command_line_command_flag():
pytest.importorskip("numpy")
output = subprocess.check_output(
[sys.executable, "-m", "threadpoolctl", "-c", "import numpy"]
)
cli_info = json.loads(output.decode("utf-8"))
this_process_info = threadpool_info()
for lib_info in cli_info:
> assert lib_info in this_process_info
E AssertionError: assert {'filepath': '/usr/lib64/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 8, 'prefix': 'libgomp', ...} in [{'architecture': 'POWER9', 'filepath': '/usr/lib64/libopenblaso-r0.3.20.so', 'internal_api': 'openblas', 'num_threads': 40, ...}, {'filepath': '/usr/lib64/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 40, 'prefix': 'libgomp', ...}]
tests/test_threadpoolctl.py:547: AssertionError
________________________ test_command_line_import_flag _________________________
@pytest.mark.skipif(
sys.version_info < (3, 7), reason="need recent subprocess.run options"
)
def test_command_line_import_flag():
result = subprocess.run(
[
sys.executable,
"-m",
"threadpoolctl",
"-i",
"numpy",
"scipy.linalg",
"invalid_package",
"numpy.invalid_sumodule",
],
capture_output=True,
check=True,
encoding="utf-8",
)
cli_info = json.loads(result.stdout)
this_process_info = threadpool_info()
for lib_info in cli_info:
> assert lib_info in this_process_info
E AssertionError: assert {'filepath': '/usr/lib64/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 8, 'prefix': 'libgomp', ...} in [{'architecture': 'POWER9', 'filepath': '/usr/lib64/libopenblaso-r0.3.20.so', 'internal_api': 'openblas', 'num_threads': 40, ...}, {'filepath': '/usr/lib64/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 40, 'prefix': 'libgomp', ...}]
tests/test_threadpoolctl.py:573: AssertionError
On s390x:
________________________ test_command_line_command_flag ________________________
def test_command_line_command_flag():
pytest.importorskip("numpy")
output = subprocess.check_output(
[sys.executable, "-m", "threadpoolctl", "-c", "import numpy"]
)
cli_info = json.loads(output.decode("utf-8"))
this_process_info = threadpool_info()
for lib_info in cli_info:
> assert lib_info in this_process_info
E AssertionError: assert {'filepath': '/usr/lib64/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 2, 'prefix': 'libgomp', ...} in [{'architecture': 'Z14', 'filepath': '/usr/lib64/libopenblaso-r0.3.20.so', 'internal_api': 'openblas', 'num_threads': 64, ...}, {'filepath': '/usr/lib64/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 64, 'prefix': 'libgomp', ...}]
tests/test_threadpoolctl.py:547: AssertionError
________________________ test_command_line_import_flag _________________________
@pytest.mark.skipif(
sys.version_info < (3, 7), reason="need recent subprocess.run options"
)
def test_command_line_import_flag():
result = subprocess.run(
[
sys.executable,
"-m",
"threadpoolctl",
"-i",
"numpy",
"scipy.linalg",
"invalid_package",
"numpy.invalid_sumodule",
],
capture_output=True,
check=True,
encoding="utf-8",
)
cli_info = json.loads(result.stdout)
this_process_info = threadpool_info()
for lib_info in cli_info:
> assert lib_info in this_process_info
E AssertionError: assert {'filepath': '/usr/lib64/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 2, 'prefix': 'libgomp', ...} in [{'architecture': 'Z14', 'filepath': '/usr/lib64/libopenblaso-r0.3.20.so', 'internal_api': 'openblas', 'num_threads': 64, ...}, {'filepath': '/usr/lib64/libgomp.so.1.0.0', 'internal_api': 'openmp', 'num_threads': 64, 'prefix': 'libgomp', ...}]
tests/test_threadpoolctl.py:573: AssertionError
The tests pass on aarch64. test_architecture was skipped.
It appears the num_threads value is different. Is that a real problem or just bad test expectations? Thanks
- Vorherrschende Sprache
- Python
- Sterne
- 434
- Forks
- 38
- Ø Merge
- 3 T. 7 Std.
- Gemergte PRs (30 T.)
- 6
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus joblib/threadpoolctl
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 55/100
joblib/threadpoolctl#279 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
limits= dict and list form don't allow full customizatonEvtl. vergeben @itamarst hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 58/100
joblib/threadpoolctl#277 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 57/100
joblib/threadpoolctl#276 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Make it possible to set active/spin wait behavior of LLVM/Intel OpenMP via `kmp_set_blocktime`Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
joblib/threadpoolctl#271 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Make it possible to inspect active/spin wait behavior of LLVM/Intel OpenMP via `kmp_get_blocktime`Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 42/100
joblib/threadpoolctl#270 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in joblib/threadpoolctl
Ähnliche Issues
-
Project submission:Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
slavakurilyak/awesome-ai-agents#845 ·
Maintainer antworten meist innerhalb von 1 Tag
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directoryEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offendifficulty:2 enhancement good first issue
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 92/100
MakazhanAlpamys/Soup#2178 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
scverse/rapids-singlecell#854 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGLEvtl. vergeben @ninglinLiu hat das vor 1 Tag übernommen. Offenarea:frontend backend:slang bug direction:input
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
random_elements(unique=True) on an OrderedDict: ZeroDivisionError once only zero weights remain, AssertionError with use_weighting=FalseEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 13 Tagen