GXF Concepts

This section covers about some of the basic definitions that are used in the GXF world.

GXF stands for Graph eXecution Format and is built around the core principle of a graph. The Graph contains nodes which follow an entity-component design pattern implementing the “composition over inheritance” paradigm. A Node itself is just a light-weight object which owns components. Components define how a node interacts with the rest of the applications. Nodes can for example be connected to each other to pass data between nodes. A special component called Codelets, can be used to execute code based on certain rules. Typically a codelet would receive data, execute some computation and publish data.

Graph

A graph is a data-driven representation of an AI application. Implementing an application by using programming code to create and link objects results in a monolithic and hard to maintain program. Instead a graph object is used to structure an application. The graph can be created using specialized tools and it can be analyzed to identify potential problems or performance bottlenecks. The graph is loaded by the GXF runtime in order to be executed.

The functional blocks of a graph are defined by the set of nodes which the graph is owning. Nodes can be queried via the graph using certain query functions. For example it is possible to search for a node by its name.

Node

GXF uses an entity-component design principle for nodes. This means that a node is a light-weight object whose main purpose is to own components. A node is a composition of components. Every component is in exactly one node. In order to customize a GXF node a developer does not derive from node as a base class, but instead composes objects out of components. Components can be used to provide a rich set of functionality to a node and thus to an application.

Every node in the graph is uniquely identifiable as described in more detail in the section about object identification.

Components

Components are the main functional blocks of an application. GXF provides a couple of components which implement features like properties, code execution and message passing. GXF also allows a developer to extend the GXF runtime by injecting its own custom components with custom features to fit a specific use case.

Codelets

The most common component is a codelet which is used for data processing and code execution. In order to implement a custom codelet the developer implements a certain set of functions like start and stop. A special system - the scheduler - will call these functions at the appropriate time as specified by the developer. Typical examples of triggering code execution are: receiving a new message from another node, or performing work on a regular schedule based on a time trigger.

Subgraph

Subgraph allows a node to wrap a whole graph and treat it like a sub-processing unit. Such subgraphs help greatly to increase the modularity of an application and allow reuse of compute graphs across applications. A subgraph’s internals are opaque to the outside world, and it employs its own scheduler.