You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Problem
python=3.11
When leveraging attacks/evasion/auto_attack.py in parallel, the multiprocess.pool() call is unconstrained and will use os.cpu_count() as a default value (all cpus). This is problematic in scenarios when all resources should not be consumed by some mechanism leveraging AutoAttack.
processes is the number of worker processes to use.
If processes is None then the number returned by os.cpu_count() is used.
Note: The functionality for multprocess.pool is slightly different in python>=3.13. It will leverage os.process_cpu_count() instead, which is an abstraction of threads available.
Evidence
Jupyter notebook leveraging parallel AutoAttack
All CPUs are maxed by this process until completion
Describe the solution you'd like
Ask
Allow users to optionally specify the number of processes that parallel AutoAttack will use within its pool.
291 ++ with multiprocess.get_context("spawn").Pool(processes=pool_size) as pool:
Describe alternatives you've considered
This is a feature to allow users the ability to control resource consumption with parallel execution of AutoAttack (with the addition of not consuming all CPUs in all cases if unmodified by a user). The above example could be reworked for cleaner code, but the premise of exposing a new param for users to control pool size would still be necessary for this feature.
The text was updated successfully, but these errors were encountered:
lockwoodar
changed the title
Allow constraint of pool resources on multiprocess.pool() execution on parallel AutoAttack
Allow constraint of pool resources on multiprocess.pool() execution within parallel AutoAttack
Nov 22, 2024
Is your feature request related to a problem? Please describe.
Problem
python=3.11
When leveraging
attacks/evasion/auto_attack.py
in parallel, the multiprocess.pool() call is unconstrained and will useos.cpu_count()
as a default value (all cpus). This is problematic in scenarios when all resources should not be consumed by some mechanism leveraging AutoAttack.Note: The functionality for multprocess.pool is slightly different in python>=3.13. It will leverage
os.process_cpu_count()
instead, which is an abstraction of threads available.Evidence
Describe the solution you'd like
Ask
Allow users to optionally specify the number of processes that parallel AutoAttack will use within its pool.
Possible Solution:
parallel_pool_size
parallel_pool_size: int = 0,
import multiprocess
pool_size
as the multiprocess.pool() constraintif self.parallel
Describe alternatives you've considered
Additional context
@beat-buesser My work here is in context with the internal heart-library research I conducted for IBM located in this Internal GitLab thread
The text was updated successfully, but these errors were encountered: