This article explains how to create new NVFlare Code and NVFlare code versions.
Note: To learn how to create new NVFlare code or code versions using the Rhino SDK, see Creating a New NVFlare Code Object using the Rhino SDK.
Creating New NVFlare Code Object
To create a new NVFlare Code object, do the following.
- Go to the main project's page and select your project.
- Select Code from the menu on the left to open the Code Objects page.
- Select the Create New Code Object button to open the Create New Code Object page.
4. Select NVIDIA Flare as the Code Object Type. The page changes to show the fields needed for this object type.
5. Fill in the following fields within the new modal window:
- Name: The name you would like to provide for your Code
- Description: A description that will help you understand the nature of the Code
- Type: Version of the NVIDIA FLARE code.
- Input Data Schema: The Data Schema of the input Datasets you will run against this Code. Note: Your selection here will affect what Dataset are selectable to be run with your Code when it comes to running your Code
- Output Data Schema: The Data Schema for the output Dataset that will be produced as a result of running this Code. You can also select the option to [Auto-generate Data Schema from Data]. For more information about auto-generating Data schemas, please refer to Auto-Generated Data Schemas.
6. Next select your container. The Docker container you would like to execute when running this Code. This will either be a container you have created yourself and pushed to your ECR or a stock ECR image provided by Rhino. If you need a refresher on pushing containers to your ECR, please refer to Pushing Containers to the ECR. When you click on the drop-down to select your container, you will be presented with two different sections that contain various container images:
- Workgroup Images: These will be all the containers you have pushed to your workgroup's ECR. If you have not pushed anything to your workgroups ECR, this will be blank.
- Rhino Images: These are a few container images that Rhino provides to users as utilities to help users. Currently, there are no NVFlare images that are provided by default from Rhino. But for more information on the containers that Rhino does provide, please refer to What are these container images provided under the section Rhino Images when creating Code?
7. After you've completed your details, you can choose to set required compute resources. If you want to do this, go to the Setting Required Compute Resources (Auto-scaling) section on this page.
8. When complete, select the Create New Code button to create the new Code Object.
9. The code object appears on the Code Object page.
Setting Required Compute Resources (Auto-scaling)
NOTE: This feature is only available if you are running on the Google Cloud Platform (GCP). For NVFlare code objects and code runs, you can adjust autoscaling methods for both the NVFlare Server and the NVFlare Client. For the NVFlare Server, you can only specify the CPU and RAM.
Autoscaling allows Rhino to run Code Runs on additional compute resources when the default Rhino Client capacity is not sufficient. This capability is designed to support resource‑intensive, "bursty"(processing tasks occur in short, intense or irregular spurts), or GPU‑based workloads while improving isolation, reliability, and cost efficiency. With autoscaling enabled, Rhino provisions temporary cloud VMs on demand, executes workloads on those VMs, and automatically terminates them when execution completes.
To help you make more efficient use of your computing resources and save on costs, you can indicate the minimum number of CPUs, amount of RAM, the disk size (VRAM), as well as the type and number of GPUs. You can adjust these settings when you create a code object and also when you run your code. Note that adjustments do not persist and will need to be reset with each run.
To set the required compute resources, complete the following steps.
-
In the Required Compute Resources section, move the
No minimum, allow any compute requirements slider to the right.
The compute resources that can be changed become visible.
- Next, make changes to the settings as needed. Note that these settings changes do not persist the next time you run the code object or the code run. The settings are explained below.
| Setting | Description | Usage Notes |
| CPU MIN | The minimum number of CPU cores on which your code will be run. | If the CPU MIN is too low, you might see slow code execution or throttling. |
| RAM MIN | The minimum amount of RAM (main memory) that you want to allocate to running your code. | If this is too low, you might see an out-of-memory crash or slowness in execution due to disk swapping. |
| DISK SIZE | Amount of storage allocated to the instance. | Increasing this setting increases capacity (not necessarily speed) |
| GPU TYPE | The model of GPU hardware. The number of GPUs indicate the number of GPUs attached to the instance. | If your code isn’t written to use multiple GPUs, extra GPUs might not be used. Note that GPU availability depends on the selected cloud region, Project‑level GPU quotas, and the current capacity at the cloud provider. |
- Select Run without GPU if no GPU instance is available if your code supports CPU fallback, or if your GPU capacity is limited, but you are fine with slower results. This option can be good if you are debugging or testing, running small datasets, or running inference for small batches.
- Select Always create a new virtual machine allows GCP. By default a new virtual machine is always created at runtime.
- When complete, click Create New Code Object or start a Code Run.
Creating a New NVFlare Code Version using the Rhino FCP UI
To create a new version, complete the following steps.
- Go to the page that has the original object you want to create a new version of.
- In the upper right corner of the box where your original object is, select the + New Version button.
- A new window appears that allows you to create a new version of your object.
Getting Help
If you have received an error or run into any issues throughout the process, please reach out to support@rhinohealth.com for more assistance.