DeployedGraph¶
The DeployedGraph class orchestrates distributed execution of Falcon graphs using Ray.
Overview¶
DeployedGraph wraps a Graph and handles:
- Ray actor initialization for each node
- Distributed sample generation and training
- Coordination between nodes during inference
Class Reference¶
DeployedGraph
¶
Initialize a DeployedGraph with the given conceptual graph of nodes.
Note: This class uses falcon.info(), falcon.warning() etc. for logging. These functions use the module-level logger set by cli.py via set_logger().
Source code in falcon/core/deployed_graph.py
deploy_nodes
¶
Deploy all nodes in the graph as Ray actors.
Source code in falcon/core/deployed_graph.py
sample
¶
Run forward sampling through the graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_samples
|
Number of samples to generate |
required | |
conditions
|
Optional dict of pre-set conditions (arrays/tensors) |
None
|
Returns:
| Type | Description |
|---|---|
|
List[Dict[str, ObjectRef]]: One dict per sample with refs to all node values |
Source code in falcon/core/deployed_graph.py
sample_posterior
¶
Run posterior sampling through the inference graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_samples
|
Number of samples to generate |
required | |
conditions
|
Optional dict of pre-set conditions (arrays/tensors) |
None
|
Returns:
| Type | Description |
|---|---|
|
List[Dict[str, ObjectRef]]: One dict per sample with refs to all node values |
Source code in falcon/core/deployed_graph.py
sample_proposal
¶
Run proposal sampling through the inference graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_samples
|
Number of samples to generate |
required | |
conditions
|
Optional dict of pre-set conditions (arrays/tensors) |
None
|
Returns:
| Type | Description |
|---|---|
|
List[Dict[str, ObjectRef]]: One dict per sample with refs to all node values |
Source code in falcon/core/deployed_graph.py
shutdown
¶
launch
¶
Launch training.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_manager
|
Dataset manager for samples |
required | |
observations
|
Observation data |
required | |
graph_path
|
Path to save/load graph |
None
|
|
stop_check
|
Optional callable that returns True when graceful stop is requested |
None
|
Source code in falcon/core/deployed_graph.py
save
¶
Save the deployed graph node status.
Source code in falcon/core/deployed_graph.py
load
¶
Load the deployed graph nodes status.
Source code in falcon/core/deployed_graph.py
pause
¶
Pause all nodes in the deployed graph.
resume
¶
Resume all nodes in the deployed graph.
Source code in falcon/core/deployed_graph.py
interrupt
¶
Interrupt all nodes in the deployed graph.