***

layout: overview
slug: nemo-curator/nemo\_curator/backends/ray\_data/utils
title: nemo\_curator.backends.ray\_data.utils
---------------------------------------------

## Module Contents

### Functions

| Name                                                                                                                             | Description                                                                                             |
| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| [`calculate_concurrency_for_actors_for_stage`](#nemo_curator-backends-ray_data-utils-calculate_concurrency_for_actors_for_stage) | Calculate concurrency if we want to spin up actors based on available resources and stage requirements. |
| [`is_actor_stage`](#nemo_curator-backends-ray_data-utils-is_actor_stage)                                                         | Check if the stage is an actor stage.                                                                   |

### API

<Anchor id="nemo_curator-backends-ray_data-utils-calculate_concurrency_for_actors_for_stage">
  <CodeBlock links={{"nemo_curator.stages.base.ProcessingStage":"/nemo-curator/nemo_curator/stages/base#nemo_curator-stages-base-ProcessingStage"}} showLineNumbers={false} wordWrap={true}>
    ```python
    nemo_curator.backends.ray_data.utils.calculate_concurrency_for_actors_for_stage(
        stage: nemo_curator.stages.base.ProcessingStage,
        ignore_head_node: bool = False
    ) -> tuple[int, int] | int
    ```
  </CodeBlock>
</Anchor>

<Indent>
  Calculate concurrency if we want to spin up actors based on available resources and stage requirements.

  **Returns:** `tuple[int, int] | int`

  int | tuple\[int, int]: Number of actors to use
  int: Number of workers to use
  tuple\[int, int]: tuple of min / max actors to use and number of workers to use
</Indent>

<Anchor id="nemo_curator-backends-ray_data-utils-is_actor_stage">
  <CodeBlock links={{"nemo_curator.stages.base.ProcessingStage":"/nemo-curator/nemo_curator/stages/base#nemo_curator-stages-base-ProcessingStage"}} showLineNumbers={false} wordWrap={true}>
    ```python
    nemo_curator.backends.ray_data.utils.is_actor_stage(
        stage: nemo_curator.stages.base.ProcessingStage
    ) -> bool
    ```
  </CodeBlock>
</Anchor>

<Indent>
  Check if the stage is an actor stage.
</Indent>
