Deprecation notice
This module is deprecated since v0.10.0 in favor of joblib's context manager joblib.parallel_config.
            pydvl.parallel.backends.ray
¶
    
            RayParallelBackend
¶
RayParallelBackend(config: ParallelConfig | None = None)
              Bases: ParallelBackend
Class used to wrap ray to make it transparent to algorithms.
Example
Source code in src/pydvl/parallel/backends/ray.py
                    
            executor
  
      classmethod
  
¶
executor(
    max_workers: int | None = None,
    *,
    config: ParallelConfig | None = None,
    cancel_futures: CancellationPolicy | bool = PENDING,
) -> Executor
Returns a futures executor for the parallel backend.
Example
| PARAMETER | DESCRIPTION | 
|---|---|
                max_workers
             | 
            
               Maximum number of parallel workers. 
                  
                    TYPE:
                        | 
          
                config
             | 
            
               (DEPRECATED) Object configuring parallel computation, with cluster address, number of cpus, etc. 
                  
                    TYPE:
                        | 
          
                cancel_futures
             | 
            
               Policy to use when cancelling futures after exiting an Executor. 
                  
                    TYPE:
                        | 
          
| RETURNS | DESCRIPTION | 
|---|---|
                
                    Executor
                
             | 
            
               Instance of RayExecutor.  | 
          
Source code in src/pydvl/parallel/backends/ray.py
              
            wrap
¶
    Wraps a function as a ray remote.
| PARAMETER | DESCRIPTION | 
|---|---|
                fun
             | 
            
               the function to wrap 
                  
                    TYPE:
                        | 
          
                kwargs
             | 
            
               keyword arguments to pass to @ray.remote  | 
          
| RETURNS | DESCRIPTION | 
|---|---|
                
                    Callable
                
             | 
            
               The   |