python/ray/tune/schedulers/resource_changing_scheduler.py
def evenly_distribute_cpus_gpus_distributed(
    trial_runner: "trial_runner.TrialRunner",
    trial: Trial,
    result: Dict[str, Any],
    scheduler: "ResourceChangingScheduler",
) -> Optional[PlacementGroupFactory]:
    """This is a basic uniform resource allocating function.

    The function naively balances free resources (CPUs and GPUs) between
    trials, giving them all equal priority, ensuring that all resources
    are always being used. The free resources will be placed in new bundles.
    This function assumes that all bundles are equal (there is no "head"
    bundle).

    If for some reason a trial ends up with
    more resources than there are free ones, it will adjust downwards.
    It will also ensure that trial as at least as many resources as
    it started with (``base_trial_resource``).

    This function returns a new ``PlacementGroupFactory`` with updated
    resource requirements, or None. If the returned
    ``PlacementGroupFactory`` is equal by value to the one the
    trial has currently, the scheduler will skip the update process
    internally (same with None).

    For greater customizability, use ``DistributeResources`` to create
    this function.

    Args:
        trial_runner: Trial runner for this Tune run.
            Can be used to obtain information about other trials.
        trial: The trial to allocate new resources to.
        result: The latest results of trial.
        scheduler: The scheduler calling
            the function.
    """

    if log_once("evenly_distribute_cpus_gpus_deprecated"):
        warnings.warn(
            "DeprecationWarning: `evenly_distribute_cpus_gpus` "
            "and `evenly_distribute_cpus_gpus_distributed` are "
            "being deprecated. Use `DistributeResources()` and "
            "`DistributeResources(add_bundles=False)` instead "
            "for equivalent functionality."
        )

    return _DistributeResourcesDistributedDefault(
        trial_runner, trial, result, scheduler
    )
This is a basic uniform resource allocating function.

    The function naively balances free resources (CPUs and GPUs) between
    trials, giving them all equal priority, ensuring that all resources
    are always being used. The free resources will be placed in new bundles.
    This function assumes that all bundles are equal (there is no "head"
    bundle).

    If for some reason a trial ends up with
    more resources than there are free ones, it will adjust downwards.
    It will also ensure that trial as at least as many resources as
    it started with (``base_trial_resource``).

    This function returns a new ``PlacementGroupFactory`` with updated
    resource requirements, or None. If the returned
    ``PlacementGroupFactory`` is equal by value to the one the
    trial has currently, the scheduler will skip the update process
    internally (same with None).

    For greater customizability, use ``DistributeResources`` to create
    this function.

    Args:
        trial_runner: Trial runner for this Tune run.
            Can be used to obtain information about other trials.
        trial: The trial to allocate new resources to.
        result: The latest results of trial.
        scheduler: The scheduler calling
            the function.
    
This is a basic uniform resource allocating function.
The function naively balances free resources (CPUs and GPUs) between
trials, giving them all equal priority, ensuring that all resources
are always being used. The free resources will be placed in new bundles.
This function assumes that all bundles are equal (there is no "head"
bundle).

If for some reason a trial ends up with
more resources than there are free ones, it will adjust downwards.
It will also ensure that trial as at least as many resources as
it started with (``base_trial_resource``).

This function returns a new ``PlacementGroupFactory`` with updated
resource requirements, or None. If the returned
``PlacementGroupFactory`` is equal by value to the one the
trial has currently, the scheduler will skip the update process
internally (same with None).

For greater customizability, use ``DistributeResources`` to create
this function.
This is a basic uniform resource allocating function . The function naively balances free resources ( CPUs and GPUs ) between trials giving them all equal priority ensuring that all resources are always being used . The free resources will be placed in new bundles . This function assumes that all bundles are equal ( there is no " head " bundle ) . If for some reason a trial ends up with more resources than there are free ones it will adjust downwards . It will also ensure that trial as at least as many resources as it started with ( ` ` base_trial_resource ` ` ) . This function returns a new ` ` PlacementGroupFactory ` ` with updated resource requirements or None . If the returned ` ` PlacementGroupFactory ` ` is equal by value to the one the trial has currently the scheduler will skip the update process internally ( same with None ) . For greater customizability use ` ` DistributeResources ` ` to create this function .
def evenly_distribute_cpus_gpus_distributed(
    trial_runner: "trial_runner.TrialRunner",
    trial: Trial,
    result: Dict[str, Any],
    scheduler: "ResourceChangingScheduler",
) -> Optional[PlacementGroupFactory]:
    if log_once("evenly_distribute_cpus_gpus_deprecated"):
        warnings.warn(
            "DeprecationWarning: `evenly_distribute_cpus_gpus` "
            "and `evenly_distribute_cpus_gpus_distributed` are "
            "being deprecated. Use `DistributeResources()` and "
            "`DistributeResources(add_bundles=False)` instead "
            "for equivalent functionality."
        )
    return _DistributeResourcesDistributedDefault(
        trial_runner, trial, result, scheduler
    )
def evenly_distribute_cpus_gpus_distributed ( trial_runner : "trial_runner.TrialRunner" , trial : Trial , result : Dict [ str , Any ] , scheduler : "ResourceChangingScheduler" , ) -> Optional [ PlacementGroupFactory ] : if log_once ( "evenly_distribute_cpus_gpus_deprecated" ) : warnings . warn ( "DeprecationWarning: `evenly_distribute_cpus_gpus` " "and `evenly_distribute_cpus_gpus_distributed` are " "being deprecated. Use `DistributeResources()` and " "`DistributeResources(add_bundles=False)` instead " "for equivalent functionality." ) return _DistributeResourcesDistributedDefault ( trial_runner , trial , result , scheduler )
This is a basic uniform resource allocating function.
This is a basic uniform resource allocating function .
"""This is a basic uniform resource allocating function.

    The function naively balances free resources (CPUs and GPUs) between
    trials, giving them all equal priority, ensuring that all resources
    are always being used. The free resources will be placed in new bundles.
    This function assumes that all bundles are equal (there is no "head"
    bundle).

    If for some reason a trial ends up with
    more resources than there are free ones, it will adjust downwards.
    It will also ensure that trial as at least as many resources as
    it started with (``base_trial_resource``).

    This function returns a new ``PlacementGroupFactory`` with updated
    resource requirements, or None. If the returned
    ``PlacementGroupFactory`` is equal by value to the one the
    trial has currently, the scheduler will skip the update process
    internally (same with None).

    For greater customizability, use ``DistributeResources`` to create
    this function.

    Args:
        trial_runner: Trial runner for this Tune run.
            Can be used to obtain information about other trials.
        trial: The trial to allocate new resources to.
        result: The latest results of trial.
        scheduler: The scheduler calling
            the function.
    """
trial_runner
"trial_runner.TrialRunner"
Trial runner for this Tune run.
Can be used to obtain information about other trials.
Trial runner for this Tune run . Can be used to obtain information about other trials .
trial
Trial
The trial to allocate new resources to.
The trial to allocate new resources to .
result
Dict[str, Any]
The latest results of trial.
The latest results of trial .
scheduler
"ResourceChangingScheduler"
The scheduler calling
the function.
The scheduler calling the function .