graph LR
Compilation_Orchestrator["Compilation Orchestrator"]
Compiler_Environment_Setup["Compiler Environment Setup"]
Block_Structure_Analyzer["Block Structure Analyzer"]
Loom_Engine_Manager["Loom Engine Manager"]
Loom_Input_Formatter["Loom Input Formatter"]
Compilation_Validation_Debugging["Compilation Validation & Debugging"]
Compilation_Orchestrator -- "calls" --> Compiler_Environment_Setup
Compilation_Orchestrator -- "invokes" --> Block_Structure_Analyzer
Compilation_Orchestrator -- "calls" --> Loom_Engine_Manager
Compilation_Orchestrator -- "triggers" --> Compilation_Validation_Debugging
Compiler_Environment_Setup -- "configures" --> Loom_Engine_Manager
Compiler_Environment_Setup -- "provides context to" --> Block_Structure_Analyzer
Block_Structure_Analyzer -- "registers tensor types with" --> Loom_Engine_Manager
Block_Structure_Analyzer -- "utilizes context from" --> Compiler_Environment_Setup
Loom_Engine_Manager -- "receives configuration from" --> Compiler_Environment_Setup
Loom_Engine_Manager -- "provides instance to" --> Loom_Input_Formatter
Loom_Engine_Manager -- "executes dry runs for" --> Compilation_Validation_Debugging
Loom_Engine_Manager -- "receives requests from" --> Block_Structure_Analyzer
Loom_Input_Formatter -- "uses API from" --> Loom_Engine_Manager
Compilation_Validation_Debugging -- "interacts with" --> Loom_Engine_Manager
The Block-to-Loom Compiler subsystem is the critical intermediary responsible for translating high-level Fold Blocks API definitions into an optimized, lower-level representation executable by the Loom dynamic batching engine. Its primary function is to bridge the gap between user-defined logic and the runtime execution environment, focusing on dynamic input processing and efficient TensorFlow integration.
Serves as the primary entry point for the entire Block-to-Loom compilation process. It orchestrates the high-level flow, initiating the setup of the compiler environment and subsequent compilation steps. This component is fundamental as it defines the overall compilation pipeline.
Related Classes/Methods:
Initializes the compiler's operational environment, including setting up metrics, preparing the Loom instance, and establishing the necessary context for the recursive block compilation process. It also registers custom operations, extending the compiler's capabilities. This component is crucial for preparing the execution context.
Related Classes/Methods:
tensorflow_fold.blocks.block_compiler._setup:297-329tensorflow_fold.blocks.block_compiler.register_op:60-70
Recursively traverses the high-level Fold block hierarchy. During this traversal, it analyzes each block's structure and registers its associated tensor types within the compiler's internal tracking system, ensuring all data types are properly recognized for Loom's dynamic batching. This component is central to interpreting the high-level API.
Related Classes/Methods:
tensorflow_fold.blocks.block_compiler._compile_blocks:331-365tensorflow_fold.blocks.block_compiler.register_tensor:72-74
Manages the initialization of the Loom engine and provides a direct interface for interaction. It is responsible for creating and configuring the _TaggedLoom instance, which is crucial for interacting with Loom's low-level dynamic batching operations. This component is the direct interface to the core dynamic batching engine.
Related Classes/Methods:
tensorflow_fold.blocks.block_compiler.init_loom:370-416tensorflow_fold.blocks.block_compiler.create_tagged_loom:113-139
Prepares and formats the input data into a batched structure suitable for execution by the Loom engine. This component handles the transformation of raw input into Loom-compatible representations, aligning with the project's focus on dynamic input processing. This component is vital for data ingestion into the dynamic graph.
Related Classes/Methods:
tensorflow_fold.blocks.block_compiler.build_feed_dict:442-491tensorflow_fold.blocks.block_compiler.build_loom_input_batched:493-530
Orchestrates the evaluation process, which includes initializing variables and performing dry runs of the compiled Loom graph. This is critical for validating the compilation output and debugging without requiring full TensorFlow session execution. This component ensures the correctness of the compiled output.
Related Classes/Methods: