Architecture

This page explains how a running NVIDIA FLARE system is put together: which processes exist on each machine, how they talk to each other, how a job travels from submission to completion, and how the three run modes (simulation, POC, production) relate. It is useful background for reading logs, sizing machines, and debugging deployments.

Layers

FLARE is organized in three layers:

Layer Contents
Foundation The communication framework (F3/CellNet), messaging, serialization (FOBS), security and privacy primitives.
Application Building blocks for federated workflows: controllers, executors, aggregators, persistors, filters, and the Client API.
Tooling Simulator and POC for experimentation; provisioning, Dashboard, admin CLI, deployment tooling for production.

Recipes sit on top: a recipe is a Python object that assembles application components into a job (see Job Recipes).

Processes

Each site runs one long-lived parent process and one job process per running job:

Process Code symbol Runs Responsibility
Server Parent (SP) ProcessType.SERVER_PARENT FederatedServer, ServerEngine, JobRunner Client registration, heartbeats, job scheduling, admin commands, spawning server job processes.
Server Job (SJ) ProcessType.SERVER_JOB ServerRunner Runs the job's workflow controllers, sends tasks to clients, aggregates results.
Client Parent (CP) ProcessType.CLIENT_PARENT FederatedClient, ClientEngine Registers with the server, accepts job deployments, spawns client job processes.
Client Job (CJ) ProcessType.CLIENT_JOB ClientRunner Pulls tasks, runs executors and filters, returns results.

Job processes isolate jobs from each other and from the parent: a crashing job does not take the site down. With the Docker, Kubernetes, or Slurm job launchers (see Deployment), the job "process" is a container, pod, or batch job instead of a local subprocess.

Where the training code runs

With the Client API, the user's training script calls flare.init(), flare.receive(), and flare.send(). ClientAPIExecutor in the CJ supports three execution modes:

Mode Who owns the trainer process Notes
in_process FLARE; the script runs inside the CJ. Lowest overhead.
external_process FLARE launches a separate process (for example torchrun). Bounded by launch_timeout.
attach An external system starts the trainer, which attaches to the site. Network attach connects through the Client Parent's existing endpoint; only shared-file attach creates a separate, job-specific listener.

Communication

All processes communicate through cells of the F3 communication framework (CellNet). Each cell has a fully qualified cell name (FQCN) such as server or server.<job_id>, and messages are routed by channel:

Channel Purpose Direction
SERVER_MAIN Client-to-server FL messages CP → SP
CLIENT_MAIN Server-to-client FL messages SP → CP
SERVER_COMMAND Commands to the server job SP → SJ
CLIENT_COMMAND Commands to a client job CP → CJ
SERVER_PARENT_LISTENER Requests from the server job to its parent SJ → SP
AUX_COMMUNICATION Auxiliary messages all

Cells support streaming for large payloads such as model weights. Only the server (and optionally relays, or clients with a listening_host) needs to accept inbound connections; clients connect out to the server's fed_learn_port. The scheme (grpc, tcp, http, ...) is chosen at provisioning time.

Note: Clients pull work. A client job repeatedly asks the server for its next task and submits results back; the server never pushes tasks into a client. This is why only the server must be reachable, and why get_task_timeout and submit_task_result_timeout matter for large models (see Troubleshooting).

Job Lifecycle

  1. Submit. An admin (or Recipe.execute() with ProdEnv/PocEnv) uploads a job folder: meta.json plus one folder per app. The server stores it and records the submitter's name, org, and role.
  2. Authorize. Each site checks its local authorization policy and privacy scope at deploy time (see Security).
  3. Schedule. The job scheduler on the server periodically looks at queued jobs. For each, it asks every target client's resource manager whether it can satisfy the job's resource_spec. Clients may reserve resources while answering.
  4. Decide. If the clients that answered yes satisfy min_clients and mandatory_clients, the job is dispatched; otherwise reservations are cancelled and the job stays queued.
  5. Deploy and run. Sites allocate resources, deploy the app named for them in deploy_map, and start the SJ/CJ. In secure mode each job gets a short-lived per-job certificate issued by the server's job CA.
  6. Finish. When the workflow ends (or the job is aborted), resources are freed and the server stores the job's result workspace for download.

Job states visible in nvflare job list include SUBMITTED, DISPATCHED, RUNNING, and terminal states such as FINISHED:COMPLETED, FINISHED:ABORTED, FINISHED:EXECUTION_EXCEPTION, FINISHED:ABNORMAL, FINISHED:CAN_NOT_SCHEDULE, FINISHED:FAILED_TO_RUN, and FINISHED:ABANDONED.

Run Modes

Mode Use Security Processes
Simulation (SimEnv) Algorithm development, debugging. None One process with threads (sometimes subprocesses).
POC (PocEnv, nvflare poc) Realistic multi-process test on one machine. Optional Separate SP/CP/SJ/CJ processes locally.
Production (ProdEnv) Real deployments. Full PKI and mTLS/TLS Distributed across machines.

The same job runs unchanged in all three modes; only the execution environment differs (see Execution Environments).

Workspace Layout

A site's workspace is its startup kit plus run folders:

<site workspace>/
├── startup/            # credentials and fed_*.json; created by provisioning, do not edit
├── local/              # site-local policies and defaults
│   ├── resources.json.default
│   ├── authorization.json.default
│   ├── privacy.json.sample
│   ├── log_config.json.default
│   └── custom/         # site-installed custom code (for example private filters)
├── audit.jsonl       # site-level audit events (JSON Lines)
├── log.txt
└── <job_id>/           # one folder per job run
    ├── log.txt
    ├── audit.jsonl
    └── app_<site>/
        ├── config/
        └── custom/

Three environment variables move output out of the workspace, which is useful when the workspace is read-only or on a different volume:

Variable Moves Fallback
NVFL_RESULT_ROOT Job results Workspace.
NVFL_LOG_ROOT Logs NVFL_AUDIT_ROOT, then NVFL_RESULT_ROOT, else the workspace.
NVFL_AUDIT_ROOT audit.jsonl files NVFL_LOG_ROOT, then NVFL_RESULT_ROOT, else the workspace.

When set, the folder is created with a per-site subfolder (<root>/<site_name>/) and per-job subfolders beneath it.

See Also