Skip to content

Conversation

@sanvila
Copy link
Contributor

@sanvila sanvila commented Nov 30, 2024

Hello. While building this package on a single-CPU system I noticed that two tests fail.

test_cpu_affinity_neighbor_loader() fails in this way:

E ValueError: More workers (got 2) than available cores (got 1)

and test_multithreading_neighbor_loader() fails in this way:

E ValueError: 'worker_threads' should be smaller than the total available number of threads 1 (got 2)

I guess those tests are simply not suitable to be executed on single-CPU systems, so the proposed MR uses os.cpu_count() to test before executing them.

The failures may be reproduced easily by booting with GRUB_CMDLINE_LINUX="nr_cpus=1".

Thanks.

@sanvila sanvila requested a review from wsad1 as a code owner November 30, 2024 19:03
@sanvila
Copy link
Contributor Author

sanvila commented Jun 4, 2025

Hello. On AWS instances of type c7i.large or m7i.large, having one core and 2 threads (2 vCPUs in total), this patch I proposed some time ago is not enough (still fails with the same error).

I've modified the patch to use psutil.cpu_count instead.

…tests requiring more than one

Otherwise test_cpu_affinity_neighbor_loader() fails in this way:

E    ValueError: More workers (got 2) than available cores (got 1)

and test_multithreading_neighbor_loader() fails in this way:

E    ValueError: 'worker_threads' should be smaller than the total available number of threads 1 (got 2)
auto-merge was automatically disabled June 6, 2025 19:58

Head branch was pushed to by a user without write access

@sanvila
Copy link
Contributor Author

sanvila commented Jun 6, 2025

Thank you. I'm also changing slightly the wording of the commit message to be in line with the wording of the code.

@akihironitta
Copy link
Member

Thank you. I'm also changing slightly the wording of the commit message to be in line with the wording of the code.

All commits are squashed into one when merging the PR, so it doesn't matter much, but thank you!

@codecov
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.79%. Comparing base (c211214) to head (ae237ff).
⚠️ Report is 102 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9817      +/-   ##
==========================================
- Coverage   86.11%   85.79%   -0.32%     
==========================================
  Files         496      498       +2     
  Lines       33655    34132     +477     
==========================================
+ Hits        28981    29284     +303     
- Misses       4674     4848     +174     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@akihironitta akihironitta self-assigned this Jun 7, 2025
@akihironitta akihironitta merged commit 68b6fa1 into pyg-team:master Jun 7, 2025
19 checks passed
chrisn-pik pushed a commit to chrisn-pik/pytorch_geometric that referenced this pull request Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants